Bug #83253 performance_schema digests the same query to multiple different digests
| Submitted: | 4 Oct 2016 14:02 | Modified: | 20 Dec 2016 19:27 |
|---|---|---|---|
| Reporter: | Justin Swanhart | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Performance Schema | Severity: | S1 (Critical) |
| Version: | 8 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | performance_schema | ||
[4 Oct 2016 14:02]
Justin Swanhart
[30 Nov 2016 6:29]
Mayank Prasad
Hi Justin, Thanks for reporting the issue. I am wondering about the ';' in digest text. Please let us know the reproduction steps. A repro test case would be helpful. Thanks -Mayank
[7 Dec 2016 15:03]
Justin Swanhart
I think you can reproduce this if you install PS_History numerous times. It uses: DELIMITER ;; It seems that the P_S is stripping off the first ; but not the second ;
[8 Dec 2016 15:09]
Justin Swanhart
Here is a related problem: the digest of the SET NAMES statement is apparently not case insensitive: Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select distinct db,query,digest from sys.statement_analysis ; +------+-------------------------------------+----------------------------------+ | db | query | digest | +------+-------------------------------------+----------------------------------+ | NULL | SELECT @@`version_comment` LIMIT ? | bb3f69453119b2d7b3ae40673a9d4c7c | +------+-------------------------------------+----------------------------------+ 1 row in set (0.01 sec) mysql> set names `UTF8`; Query OK, 0 rows affected (0.00 sec) mysql> set names `utf8`; Query OK, 0 rows affected (0.00 sec) mysql> select distinct db,query,digest from sys.statement_analysis ; +------+-------------------------------------------------------------------+----------------------------------+ | db | query | digest | +------+-------------------------------------------------------------------+----------------------------------+ | NULL | SELECT @@`version_comment` LIMIT ? | bb3f69453119b2d7b3ae40673a9d4c7c | | NULL | SELECT `sys` . `format_stateme ... cy` , `sys` . `format_time` ( | bb6fa1813faeb702c69ee1dc761a372f | | NULL | SET NAMES `UTF8` | 96767f5518674c82d9050a5ee44585cb | | NULL | SET NAMES `utf8` | 497c378a9ba204f8fadb1306e6b0ca83 | +------+-------------------------------------------------------------------+----------------------------------+ 4 rows in set (0.00 sec)
[10 Dec 2016 14:06]
Justin Swanhart
This particular bug happens because statements are not properly delimited by the client specified delimiter. It happened because of a typo, but here is how to reproduce it:
mysql> select distinct db,query,digest from sys.statement_analysis ;
+------+-------------------------------------+----------------------------------+
| db | query | digest |
+------+-------------------------------------+----------------------------------+
| NULL | SELECT @@`version_comment` LIMIT ? | bb3f69453119b2d7b3ae40673a9d4c7c |
+------+-------------------------------------+----------------------------------+
1 row in set (0.01 sec)
mysql> delimiter ;;
mysql> set names utf8;
-> select 1;
-> ;;
Query OK, 0 rows affected (0.00 sec)
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
mysql> select distinct db,query,digest from sys.statement_analysis ;;
+------+-------------------------------------------------------------------+----------------------------------+
| db | query | digest |
+------+-------------------------------------------------------------------+----------------------------------+
| NULL | SELECT @@`version_comment` LIMIT ? | bb3f69453119b2d7b3ae40673a9d4c7c |
| NULL | SELECT `sys` . `format_stateme ... cy` , `sys` . `format_time` ( | bb6fa1813faeb702c69ee1dc761a372f |
| NULL | SET NAMES `utf8` ; | e6fcd985d5dcc6736089e6a112baf974 |
| NULL | SET NAMES `utf8` ; | 9fbc4780e3de0cd62941f9c4872a5759 |
+------+-------------------------------------------------------------------+----------------------------------+
4 rows in set (0.00 sec)
[12 Dec 2016 8:50]
Mayank Prasad
Hello Justin, Thanks for the steps. I am working on it.
[20 Dec 2016 19:27]
Paul DuBois
Posted by developer: Noted in 5.6.36, 5.7.18, 8.0.1 changelogs. Semicolon (;) characters within or between statements could cause distinct digests to be generated from identical statements.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.043 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.