content_image/808956.jpg content_image/808960.jpg content_image/808965.jpg
Prepared statements differ from nonprepared statements in that they may contain ?  characters as parameter markers. To match a ?  in a prepared statement, a Rewriter  pattern must contain ?  in the same location. Suppose that a rewrite rule has this pattern: 

SELECT ?, 3 

The following table shows several prepared SELECT  statements and whether the rule pattern matches them. 

<img src='content_image/808956.jpg'>

## Rewriter Plugin Operational Information 

The Rewriter  plugin makes information available about its operation by means of several status variables: 

mysql> SHOW GLOBAL STATUS LIKE ’Rewriter%’; 

<img src='content_image/808960.jpg'>

For descriptions of these variables, see Rewriter Query Rewrite Plugin Status Variables. 

When you load the rules table by calling the flush_rewrite_rules()  stored procedure, if an error occurs for some rule, the CALL  statement produces an error, and the plugin sets the Rewriter_reload_error  status variable to ON : 

mysql> CALL query_rewrite.flush_rewrite_rules(); ERROR 1644 (45000): Loading of some rule(s) failed. 

mysql> SHOW GLOBAL STATUS LIKE ’Rewriter_reload_error’; 

<img src='content_image/808965.jpg'>

In this case, check the rewrite_rules  table for rows with non- NULL message  column values to see what problems exist. 

## Rewriter Plugin Use of Character Sets 

When the rewrite_rules  table is loaded into the Rewriter  plugin, the plugin interprets statements using the current global value of the character_set_client  system variable. If the global character_set_client  value is changed subsequently, the rules table must be reloaded. 

A client must have a session character_set_client  value identical to what the global value was when the rules table was loaded or rule matching does not work for that client. 

