1--source suite/query_rewrite_plugins/include/have_plugin_rewriter.inc
2
3--source suite/query_rewrite_plugins/include/install_rewriter.inc
4
5INSERT INTO query_rewrite.rewrite_rules ( pattern, replacement )
6VALUES ( 'SELECT "original"', 'SELECT "rewritten"' );
7
8CALL query_rewrite.flush_rewrite_rules();
9
10CREATE USER mysqluser1@localhost;
11--connect (conn1, localhost, mysqluser1, , test)
12--connection conn1
13
14--error ER_TABLEACCESS_DENIED_ERROR
15INSERT INTO query_rewrite.rewrite_rules ( pattern ) VALUES ( '' );
16--error ER_TABLEACCESS_DENIED_ERROR
17INSERT INTO query_rewrite.rewrite_rules ( replacement ) VALUES ( '' );
18--error ER_TABLEACCESS_DENIED_ERROR
19INSERT INTO query_rewrite.rewrite_rules ( enabled ) VALUES ( '' );
20--error ER_TABLEACCESS_DENIED_ERROR
21INSERT INTO query_rewrite.rewrite_rules ( message ) VALUES ( '' );
22
23--error ER_TABLEACCESS_DENIED_ERROR
24SELECT pattern FROM query_rewrite.rewrite_rules;
25--error ER_TABLEACCESS_DENIED_ERROR
26SELECT replacement FROM query_rewrite.rewrite_rules;
27--error ER_TABLEACCESS_DENIED_ERROR
28SELECT enabled FROM query_rewrite.rewrite_rules;
29--error ER_TABLEACCESS_DENIED_ERROR
30SELECT message FROM query_rewrite.rewrite_rules;
31
32--error ER_TABLEACCESS_DENIED_ERROR
33UPDATE query_rewrite.rewrite_rules SET pattern = '';
34--error ER_TABLEACCESS_DENIED_ERROR
35UPDATE query_rewrite.rewrite_rules SET replacement = '';
36--error ER_TABLEACCESS_DENIED_ERROR
37UPDATE query_rewrite.rewrite_rules SET enabled = '';
38--error ER_TABLEACCESS_DENIED_ERROR
39UPDATE query_rewrite.rewrite_rules SET message = '';
40
41--error ER_PROCACCESS_DENIED_ERROR
42CALL query_rewrite.flush_rewrite_rules();
43
44SELECT 'original';
45
46--disconnect conn1
47--connection default
48DROP USER mysqluser1@localhost;
49
50--source suite/query_rewrite_plugins/include/uninstall_rewriter.inc
51