The Rewriter Query Rewrite Plugin 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. Prepared Statement Whether Pattern Matches Statement PREPARE s AS ’SELECT 3, 3’ Yes PREPARE s AS ’SELECT ?, 3’ Yes PREPARE s AS ’SELECT 3, ?’ No PREPARE s AS ’SELECT ?, ?’ No 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%’; +-----------------------------------+-------+ | Variable_name | Value | +-----------------------------------+-------+ | Rewriter_number_loaded_rules | 1 | | Rewriter_number_reloads | 5 | | Rewriter_number_rewritten_queries | 1 | | Rewriter_reload_error | ON | +-----------------------------------+-------+ 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’; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | Rewriter_reload_error | ON | +-----------------------+-------+ 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. 1092