29 lines
1.2 KiB
Plaintext

#
# Test of rewrites of insert statements.
#
# This test is indeed rather pointless unless the plugin accepts insert
# statements as pattern, which it currently does not.
call mtr.add_suppression("Plugin rewriter reported: 'Some rules failed to load.'");
Warnings:
Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release.
Warnings:
Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release.
# Query rewrite plugin was installed.
INSERT INTO query_rewrite.rewrite_rules ( pattern, replacement )
VALUES ( 'INSERT INTO test.t1 ( a, b ) VALUES ( ?, ? )',
'INSERT INTO test.t1 ( b, a ) VALUES ( ?, ? )' );
CALL query_rewrite.flush_rewrite_rules();
ERROR 45000: Loading of some rule(s) failed.
SELECT * FROM query_rewrite.rewrite_rules;
id pattern pattern_database replacement enabled message
1 INSERT INTO test.t1 ( a, b ) VALUES ( ?, ? ) NULL INSERT INTO test.t1 ( b, a ) VALUES ( ?, ? ) YES Pattern needs to be a a select statement.
CREATE TABLE t1 ( a INT, b INT );
INSERT INTO test.t1 ( a, b ) VALUES ( 1, 2 );
SELECT * FROM t1;
a b
1 2
DROP TABLE t1;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
# Query rewrite plugin was queued for uninstalling.