Commit ff82741d authored by Sergei Golubchik's avatar Sergei Golubchik

fix pfs_digest* tests.

a different fix for
    Bug#14069132 : STATEMENT DIGESTS DUPLICATE CALL STATEMENTS OF THE SAME NORMALIZED FORM
parent 48c54cd3
......@@ -112,43 +112,43 @@ DROP TRIGGER trg;
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
statements_digest e4a84a547a18a89f4708509a720def58 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
statements_digest ab105aea9c15b3842ad161d18349f9c4 SELECT ? FROM t1 1 0 0 0
statements_digest 835083efbaa5d8c29d01d558abb8216b SELECT ? FROM `t1` 1 0 0 0
statements_digest 6ff375c6f4b283de91711a78bd91b953 SELECT ?, ... FROM t1 2 0 0 0
statements_digest 4879fbad051c94ff76e6ad29effa4903 SELECT ? FROM t2 1 0 0 0
statements_digest b1ea4bca7c91ebd647b6b81e80a2ef94 SELECT ?, ... FROM t2 2 0 0 0
statements_digest 14d463345df747d42a036019a5988a9b INSERT INTO t1 VALUES (?) 1 1 0 0
statements_digest ff2d8aa1fd516f5e25b0faf7b1c80b04 INSERT INTO t2 VALUES (?) 1 1 0 0
statements_digest 430116339c3a5bf0a1aa9a96e9cfd354 INSERT INTO t3 VALUES (...) 4 4 0 0
statements_digest 01467137a1045e85119538ea248d52dd INSERT INTO t4 VALUES (...) 1 1 0 0
statements_digest b201a20a2a534d2789750270b7f90fab INSERT INTO t5 VALUES (...) 1 1 0 0
statements_digest b1a5f24770580f243ad6704590165d90 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
statements_digest bbbf619ec8ca4ec4a4da28a71eb12a2f INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
statements_digest de7bdb298875f4ef826383e3fce53ef9 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
statements_digest f79cdc2ddca01e9ea89782b3548b01e3 INSERT INTO t1 VALUES ( NULL ) 1 1 0 0
statements_digest cd4a3e419e2eaed79f66a705ff002910 INSERT INTO t6 VALUES (...) 5 5 0 0
statements_digest f2d57cea9e78e7b37c4509c0564dd1cc SELECT ? + ? 3 0 0 0
statements_digest 02396199eed2345830efcf00e51107ee SELECT ? 1 0 0 0
statements_digest 7c5b403e11cb8fa41954f8b81d47fb44 CREATE SCHEMA statements_digest_temp 2 2 0 0
statements_digest d5c2a9eedc964698407667a633301e69 DROP SCHEMA statements_digest_temp 2 0 0 0
statements_digest add5619cd2761d01c66b68b50a4c0476 SELECT ? FROM no_such_table 1 0 0 1
statements_digest f59e7a7dbcdc342b7ea72ae24e5ef081 CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1
statements_digest b42311b2b180ba680ebb286f671982f1 DROP TABLE dup_table 1 0 0 0
statements_digest 8af43d157243ebdc9dcb1a9502acdd24 INSERT INTO t11 VALUES (?) 1 1 1 0
statements_digest cee5b131782212e0ba1cd76ba28485c4 SHOW WARNINGS 1 0 0 0
statements_digest 438623439c3a1702203d6190795127ad PREPARE stmt FROM ? 1 0 0 0
statements_digest e53b71815168ad954fd921a6ae1860c9 EXECUTE stmt 2 0 0 0
statements_digest 3bccf5096186ceaf50c11c3deb4e21cf DEALLOCATE PREPARE stmt 1 0 0 0
statements_digest e20f8d5cb15105439af39592b79c0edd CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0
statements_digest 10298a45c9f7114e4985de53ca99bda7 CALL p1 ( ) 2 0 0 0
statements_digest efc046c5d04acb8afa61326f759ad380 DROP PROCEDURE p1 1 0 0 0
statements_digest 8eaf9e776b79f24f2b8fae8efb92d8a4 CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0
statements_digest b364c71d8c904eb9e95df4d0ca258c00 SELECT func (...) 2 0 0 0
statements_digest 88e7ac9784e4561d12fadccde6ea704a DROP FUNCTION func 1 0 0 0
statements_digest 15deeaae5594a691cf21abd4439ee5e6 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 0 0 0
statements_digest 074e38814943a6dce874784d21fea89d INSERT INTO t12 VALUES (?) 2 2 0 0
statements_digest 2b5b02ba54b27638d5d8dbe917ff432d DROP TRIGGER trg 1 0 0 0
statements_digest 35a1dd67493f13a363597c041f170f3a TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
statements_digest 26dfbd081fcf7f115c1d0469a486a359 SELECT ? FROM t1 1 0 0 0
statements_digest 3f616e69aa50da84e83c0fb36e2097a8 SELECT ? FROM `t1` 1 0 0 0
statements_digest 76856b08e7f7d5abb33be516e1f67774 SELECT ?, ... FROM t1 2 0 0 0
statements_digest 633ab3778bbdfd8d19fbc374096260f6 SELECT ? FROM t2 1 0 0 0
statements_digest 8327dfae0814061f44ed8dffa9dc6435 SELECT ?, ... FROM t2 2 0 0 0
statements_digest 839fb88fc8518181883672c04cb63f49 INSERT INTO t1 VALUES (?) 1 1 0 0
statements_digest 2ba9122b6d1fc0a088f7bda1288fa09c INSERT INTO t2 VALUES (?) 1 1 0 0
statements_digest 8b6edf8409045279d23afdcafb84bfed INSERT INTO t3 VALUES (...) 4 4 0 0
statements_digest bb8eaef8479c82506d33f77ddb5c28aa INSERT INTO t4 VALUES (...) 1 1 0 0
statements_digest f994e1321d5b06de770ff4831308bac4 INSERT INTO t5 VALUES (...) 1 1 0 0
statements_digest 0dba4196aed38abb1519d6244403cb17 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
statements_digest 92f8ab3ae191fe475bfadc774fa94043 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
statements_digest 3137bda2c67d2e56caf769ec6ce82659 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
statements_digest 9422d1121371a267a413108efc89baf9 INSERT INTO t1 VALUES ( NULL ) 1 1 0 0
statements_digest 5f5d0d6bedf99549b5ebbe3a405328da INSERT INTO t6 VALUES (...) 5 5 0 0
statements_digest 37db9f5b30f6aab26e96da3b4a1453e8 SELECT ? + ? 3 0 0 0
statements_digest 3a5796055ae14f5e4b6e4d8544f02f6e SELECT ? 1 0 0 0
statements_digest 45116c5e93c234b72dd9a3abcefc88c5 CREATE SCHEMA statements_digest_temp 2 2 0 0
statements_digest ced4041d0418bc07691afc32d83136a3 DROP SCHEMA statements_digest_temp 2 0 0 0
statements_digest 15a9faf206e03a368cff0515fdc66e49 SELECT ? FROM no_such_table 1 0 0 1
statements_digest e972017fec3cc0ed0faae39fac081252 CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1
statements_digest b7c43333163beb24690a9a48e9183345 DROP TABLE dup_table 1 0 0 0
statements_digest 9bfd4998690c1d2a177545f1222ae63d INSERT INTO t11 VALUES (?) 1 1 1 0
statements_digest c574ec5908ae7f1cf1381d5d20e5c0fa SHOW WARNINGS 1 0 0 0
statements_digest fb36b794ae04d52a096cc57a7f019b68 PREPARE stmt FROM ? 1 0 0 0
statements_digest c865e57de1bfb41a6508d4ab11451604 EXECUTE stmt 2 0 0 0
statements_digest 260a16ff0083fe404cd7e9f4b769ba9a DEALLOCATE PREPARE stmt 1 0 0 0
statements_digest 32e03dcacd4f3c6c48919405da64db7f CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0
statements_digest 2350c8efd325c3037260912f4819fcc4 CALL p1 ( ) 2 0 0 0
statements_digest d109091bb6714e45fd781adf6b46804e DROP PROCEDURE p1 1 0 0 0
statements_digest 8dc1dbd5a0f430ff529d9e6305253a9a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0
statements_digest dd5c4f35de90b2c4c0fb9a7013d8f255 SELECT func (...) 2 0 0 0
statements_digest 61a04e3100cef2fe94313ed4014e2eae DROP FUNCTION func 1 0 0 0
statements_digest b118ca18d17608e117c88d2678296ec6 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 0 0 0
statements_digest a6f5c29379cdd3edfe561f13e276ea31 INSERT INTO t12 VALUES (?) 2 2 0 0
statements_digest ad26862793866ae1fe5dbb1ab4381c05 DROP TRIGGER trg 1 0 0 0
####################################
# CLEANUP
####################################
......
......@@ -125,43 +125,43 @@ DROP TRIGGER trg;
####################################
SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
schema_name digest digest_text count_star
statements_digest e4a84a547a18a89f4708509a720def58 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
statements_digest ab105aea9c15b3842ad161d18349f9c4 SELECT ? FROM t1 1
statements_digest 835083efbaa5d8c29d01d558abb8216b SELECT ? FROM `t1` 1
statements_digest 6ff375c6f4b283de91711a78bd91b953 SELECT ?, ... FROM t1 2
statements_digest 4879fbad051c94ff76e6ad29effa4903 SELECT ? FROM t2 1
statements_digest b1ea4bca7c91ebd647b6b81e80a2ef94 SELECT ?, ... FROM t2 2
statements_digest 14d463345df747d42a036019a5988a9b INSERT INTO t1 VALUES (?) 1
statements_digest ff2d8aa1fd516f5e25b0faf7b1c80b04 INSERT INTO t2 VALUES (?) 1
statements_digest 430116339c3a5bf0a1aa9a96e9cfd354 INSERT INTO t3 VALUES (...) 4
statements_digest 01467137a1045e85119538ea248d52dd INSERT INTO t4 VALUES (...) 1
statements_digest b201a20a2a534d2789750270b7f90fab INSERT INTO t5 VALUES (...) 1
statements_digest b1a5f24770580f243ad6704590165d90 INSERT INTO t1 VALUES (?) /* , ... */ 2
statements_digest bbbf619ec8ca4ec4a4da28a71eb12a2f INSERT INTO t3 VALUES (...) /* , ... */ 1
statements_digest de7bdb298875f4ef826383e3fce53ef9 INSERT INTO t5 VALUES (...) /* , ... */ 1
statements_digest f79cdc2ddca01e9ea89782b3548b01e3 INSERT INTO t1 VALUES ( NULL ) 1
statements_digest cd4a3e419e2eaed79f66a705ff002910 INSERT INTO t6 VALUES (...) 5
statements_digest f2d57cea9e78e7b37c4509c0564dd1cc SELECT ? + ? 3
statements_digest 02396199eed2345830efcf00e51107ee SELECT ? 1
statements_digest 7c5b403e11cb8fa41954f8b81d47fb44 CREATE SCHEMA statements_digest_temp 2
statements_digest d5c2a9eedc964698407667a633301e69 DROP SCHEMA statements_digest_temp 2
statements_digest add5619cd2761d01c66b68b50a4c0476 SELECT ? FROM no_such_table 1
statements_digest f59e7a7dbcdc342b7ea72ae24e5ef081 CREATE TABLE dup_table ( c CHARACTER (?) ) 2
statements_digest b42311b2b180ba680ebb286f671982f1 DROP TABLE dup_table 1
statements_digest 8af43d157243ebdc9dcb1a9502acdd24 INSERT INTO t11 VALUES (?) 1
statements_digest cee5b131782212e0ba1cd76ba28485c4 SHOW WARNINGS 1
statements_digest 438623439c3a1702203d6190795127ad PREPARE stmt FROM ? 1
statements_digest e53b71815168ad954fd921a6ae1860c9 EXECUTE stmt 2
statements_digest 3bccf5096186ceaf50c11c3deb4e21cf DEALLOCATE PREPARE stmt 1
statements_digest e20f8d5cb15105439af39592b79c0edd CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1
statements_digest 10298a45c9f7114e4985de53ca99bda7 CALL p1 ( ) 2
statements_digest efc046c5d04acb8afa61326f759ad380 DROP PROCEDURE p1 1
statements_digest 8eaf9e776b79f24f2b8fae8efb92d8a4 CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1
statements_digest b364c71d8c904eb9e95df4d0ca258c00 SELECT func (...) 2
statements_digest 88e7ac9784e4561d12fadccde6ea704a DROP FUNCTION func 1
statements_digest 15deeaae5594a691cf21abd4439ee5e6 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1
statements_digest 074e38814943a6dce874784d21fea89d INSERT INTO t12 VALUES (?) 2
statements_digest 2b5b02ba54b27638d5d8dbe917ff432d DROP TRIGGER trg 1
statements_digest 35a1dd67493f13a363597c041f170f3a TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
statements_digest 26dfbd081fcf7f115c1d0469a486a359 SELECT ? FROM t1 1
statements_digest 3f616e69aa50da84e83c0fb36e2097a8 SELECT ? FROM `t1` 1
statements_digest 76856b08e7f7d5abb33be516e1f67774 SELECT ?, ... FROM t1 2
statements_digest 633ab3778bbdfd8d19fbc374096260f6 SELECT ? FROM t2 1
statements_digest 8327dfae0814061f44ed8dffa9dc6435 SELECT ?, ... FROM t2 2
statements_digest 839fb88fc8518181883672c04cb63f49 INSERT INTO t1 VALUES (?) 1
statements_digest 2ba9122b6d1fc0a088f7bda1288fa09c INSERT INTO t2 VALUES (?) 1
statements_digest 8b6edf8409045279d23afdcafb84bfed INSERT INTO t3 VALUES (...) 4
statements_digest bb8eaef8479c82506d33f77ddb5c28aa INSERT INTO t4 VALUES (...) 1
statements_digest f994e1321d5b06de770ff4831308bac4 INSERT INTO t5 VALUES (...) 1
statements_digest 0dba4196aed38abb1519d6244403cb17 INSERT INTO t1 VALUES (?) /* , ... */ 2
statements_digest 92f8ab3ae191fe475bfadc774fa94043 INSERT INTO t3 VALUES (...) /* , ... */ 1
statements_digest 3137bda2c67d2e56caf769ec6ce82659 INSERT INTO t5 VALUES (...) /* , ... */ 1
statements_digest 9422d1121371a267a413108efc89baf9 INSERT INTO t1 VALUES ( NULL ) 1
statements_digest 5f5d0d6bedf99549b5ebbe3a405328da INSERT INTO t6 VALUES (...) 5
statements_digest 37db9f5b30f6aab26e96da3b4a1453e8 SELECT ? + ? 3
statements_digest 3a5796055ae14f5e4b6e4d8544f02f6e SELECT ? 1
statements_digest 45116c5e93c234b72dd9a3abcefc88c5 CREATE SCHEMA statements_digest_temp 2
statements_digest ced4041d0418bc07691afc32d83136a3 DROP SCHEMA statements_digest_temp 2
statements_digest 15a9faf206e03a368cff0515fdc66e49 SELECT ? FROM no_such_table 1
statements_digest e972017fec3cc0ed0faae39fac081252 CREATE TABLE dup_table ( c CHARACTER (?) ) 2
statements_digest b7c43333163beb24690a9a48e9183345 DROP TABLE dup_table 1
statements_digest 9bfd4998690c1d2a177545f1222ae63d INSERT INTO t11 VALUES (?) 1
statements_digest c574ec5908ae7f1cf1381d5d20e5c0fa SHOW WARNINGS 1
statements_digest fb36b794ae04d52a096cc57a7f019b68 PREPARE stmt FROM ? 1
statements_digest c865e57de1bfb41a6508d4ab11451604 EXECUTE stmt 2
statements_digest 260a16ff0083fe404cd7e9f4b769ba9a DEALLOCATE PREPARE stmt 1
statements_digest 32e03dcacd4f3c6c48919405da64db7f CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1
statements_digest 2350c8efd325c3037260912f4819fcc4 CALL p1 ( ) 2
statements_digest d109091bb6714e45fd781adf6b46804e DROP PROCEDURE p1 1
statements_digest 8dc1dbd5a0f430ff529d9e6305253a9a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1
statements_digest dd5c4f35de90b2c4c0fb9a7013d8f255 SELECT func (...) 2
statements_digest 61a04e3100cef2fe94313ed4014e2eae DROP FUNCTION func 1
statements_digest b118ca18d17608e117c88d2678296ec6 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1
statements_digest a6f5c29379cdd3edfe561f13e276ea31 INSERT INTO t12 VALUES (?) 2
statements_digest ad26862793866ae1fe5dbb1ab4381c05 DROP TRIGGER trg 1
SELECT digest, digest_text FROM performance_schema.events_statements_current;
digest digest_text
####################################
......
......@@ -6138,7 +6138,7 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
{
LEX *lex= thd->lex;
bool err= parse_sql(thd, parser_state, NULL);
bool err= parse_sql(thd, parser_state, NULL, true);
if (!err)
{
......@@ -6246,7 +6246,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length)
lex_start(thd);
mysql_reset_thd_for_next_command(thd, opt_userstat_running);
if (!parse_sql(thd, & parser_state, NULL) &&
if (!parse_sql(thd, & parser_state, NULL, true) &&
all_tables_not_ok(thd, lex->select_lex.table_list.first))
error= 1; /* Ignore question */
thd->end_statement();
......@@ -8119,9 +8119,8 @@ extern int MYSQLparse(void *thd); // from sql_yacc.cc
@retval TRUE on parsing error.
*/
bool parse_sql(THD *thd,
Parser_state *parser_state,
Object_creation_ctx *creation_ctx)
bool parse_sql(THD *thd, Parser_state *parser_state,
Object_creation_ctx *creation_ctx, bool do_pfs_digest)
{
bool ret_value;
DBUG_ENTER("parse_sql");
......@@ -8143,7 +8142,7 @@ bool parse_sql(THD *thd,
#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
/* Start Digest */
thd->m_parser_state->m_lip.m_digest_psi=
MYSQL_DIGEST_START(thd->m_statement_psi);
MYSQL_DIGEST_START(do_pfs_digest ? thd->m_statement_psi : NULL);
#endif
/* Parse the query. */
......
......@@ -46,9 +46,8 @@ bool insert_precheck(THD *thd, TABLE_LIST *tables);
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table);
bool parse_sql(THD *thd,
Parser_state *parser_state,
Object_creation_ctx *creation_ctx);
bool parse_sql(THD *thd, Parser_state *parser_state,
Object_creation_ctx *creation_ctx, bool do_pfs_digest=false);
void free_items(Item *item);
void cleanup_items(Item *item);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment