sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6k stars 978 forks source link

Investigate how MySQL's `performance_schema` generates digest #2072

Open renecannao opened 5 years ago

renecannao commented 5 years ago

We need to investigate how MySQL's performance_schema generates digest in order to evaluate the possibility of generating the same digests.

gunnicom commented 5 years ago

Maybe here? https://github.com/MariaDB/server/blob/10.2/storage/perfschema/pfs_digest.cc Or here? https://github.com/MariaDB/server/blob/10.2/sql/sql_digest.cc One last https://github.com/MariaDB/server/blob/10.2/mysys_ssl/my_md5.cc I hope this helps.

yakirgb commented 4 years ago

Pay attention that default digests in 5.7 and 8.0 are different, The digest in MySQL 8 is a sha256 hash whereas in 5.6 and 5.7 it was an md5 hash: https://dev.mysql.com/doc/refman/8.0/en/performance-schema-statement-digests.html

mysql-57:performance_schema> select digest from events_statements_current limit 1;
+----------------------------------+
| digest                           |
+----------------------------------+
| fcba7aa3c8e5dc88d94a5fb7b997e12e |
+----------------------------------+

mysql-80:performance_schema> select digest from events_statements_current limit 1;
+------------------------------------------------------------------+
| digest                                                           |
+------------------------------------------------------------------+
| 81c1f35c1b9cd75a4434602db78239722a503b8d724ad5b7bf972bb1c9199e24 |
+------------------------------------------------------------------+
1 row in set (0.00 sec)