Current Path : /usr/opt/mysql57/mysql-test/suite/query_rewrite_plugins/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/mysql57/mysql-test/suite/query_rewrite_plugins/r/digest_collision.result |
# # Test of the case when two rewrite rule pattern have the same digest. # SET sql_mode = 'PIPES_AS_CONCAT'; Warnings: Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. CREATE TABLE t1 ( a VARCHAR(10) ); 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. # This will supposedly fill up the token buffer. # We have to keep entries in the error log unique, we can't clear it. SET @pattern1 = 'SELECT * FROM test.t1 WHERE a = "digest_collision.test" ' || repeat ( 'UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"', 120 ); SET @pattern2 = concat ( @pattern1, 'UNION SELECT 1' ); SET @nonmatching_query = concat ( @pattern1, 'UNION SELECT 2' ); INSERT INTO query_rewrite.rewrite_rules ( pattern, replacement ) VALUES ( @pattern1, 'SELECT "Rewrite rule #1"' ), ( @pattern2, 'SELECT "Rewrite rule #2"' ); CALL query_rewrite.flush_rewrite_rules(); Warnings: Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release. SELECT group_concat(replacement) = 'SELECT "Rewrite rule #1",SELECT "Rewrite rule #2"' AS digests_indeed_collide FROM query_rewrite.rewrite_rules GROUP BY pattern_digest; digests_indeed_collide 1 SELECT char_length(pattern) FROM query_rewrite.rewrite_rules; char_length(pattern) 7376 7390 PREPARE pattern1_stmt FROM @pattern1; Warnings: Note 1105 Query 'SELECT * FROM test.t1 WHERE a = "digest_collision.test" UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM t EXECUTE pattern1_stmt; Rewrite rule #1 Rewrite rule #1 PREPARE pattern2_stmt FROM @pattern2; Warnings: Note 1105 Query 'SELECT * FROM test.t1 WHERE a = "digest_collision.test" UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM test.t1 WHERE a = "digest_collision.test"UNION SELECT * FROM t EXECUTE pattern2_stmt; Rewrite rule #2 Rewrite rule #2 SET @@global.rewriter_verbose = 2; PREPARE nonmatching_stmt FROM @nonmatching_query; EXECUTE nonmatching_stmt; a 2 SET @@global.rewriter_verbose = DEFAULT; CREATE TABLE IF NOT EXISTS error_log ( line TEXT ); DELETE FROM error_log; LOAD DATA LOCAL INFILE 'ERROR_LOG' INTO TABLE error_log FIELDS TERMINATED BY '\t'; UPDATE error_log SET line = replace ( line, '\r', '' ); SELECT search_error_log( '[Note]', '%Plugin Rewriter reported: ''Statement "SELECT * FROM test.t1 ' || 'WHERE a = "digest_collision.test"%' ); search_error_log( '[Note]', '%Plugin Rewriter reported: ''Statement "SELECT * FROM test.t1 ' || 'WHERE a = "digest_collision.test"%' ) [Note] Plugin Rewriter reported: 'Statement "SELECT * FROM test.t1 WHERE a = "digest_collision.test" UNION SELECT * FROM test.t1 WHERE a = "diges..." with digest "a791200aa1f826531b128ea5f7ca3b99" matched some rule but had different parse tree and/or literals.' DROP TABLE t1; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown # Query rewrite plugin was queued for uninstalling. DROP TABLE error_log; DROP FUNCTION search_error_log; SET sql_mode = DEFAULT;