#################################### # SETUP #################################### CREATE DATABASE statements_digest; USE statements_digest; CREATE TABLE t1(a int); CREATE TABLE t2(a int); CREATE TABLE t3(a int, b int); CREATE TABLE t4(a int, b int); CREATE TABLE t5(a int, b int, c int); TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; #################################### # EXECUTION #################################### SELECT 1 FROM t1; 1 SELECT 1 FROM `t1`; 1 SELECT 1,2 FROM t1; 1 2 SELECT 1, 2, 3, 4 FROM t1; 1 2 3 4 SELECT 1 FROM t2; 1 SELECT 1,2 FROM t2; 1 2 SELECT 1, 2, 3, 4 FROM t2; 1 2 3 4 INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); INSERT INTO t3 VALUES (1, 2); INSERT INTO t4 VALUES (1, 2); INSERT INTO t5 VALUES (1, 2, 3); INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t1 VALUES (1), (2), (3), (4); INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6); INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9); SELECT 1 + 1; 1 + 1 2 SELECT 1; 1 1 SELECT 1 /* This is an inline comment */ + 1; 1 /* This is an inline comment */ + 1 2 SELECT 1+ /* this is a multiple-line comment */ 1; 1+ /* this is a multiple-line comment */ 1 2 CREATE SCHEMA statements_digest_temp; DROP SCHEMA statements_digest_temp; CREATE DATABASE statements_digest_temp; DROP DATABASE statements_digest_temp; SELECT 1 from t11; ERROR 42S02: Table 'statements_digest.t11' doesn't exist create table t11 (c char(4)); create table t11 (c char(4)); ERROR 42S01: Table 't11' already exists insert into t11 values("MySQL"); Warnings: Warning 1265 Data truncated for column 'c' at row 1 #################################### # QUERYING PS STATEMENT DIGEST #################################### SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS, SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS 025af09b416617ee444962d35913c0ab TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 2448fef9bf02af329f4379caa8311a29 SELECT ? FROM t1 1 0 0 0 8ffffc32710da95472a3eae27f5a4138 SELECT ? FROM `t1` 1 0 0 0 0fb24bb23dd5e0781c8be24d072a4e0d SELECT ?, ... FROM t1 2 0 0 0 bfb5a2acdbc5fce89461e691841090d8 SELECT ? FROM t2 1 0 0 0 320290df27bd6c85764c3d9293087f6d SELECT ?, ... FROM t2 2 0 0 0 e71851702cece9c252fe03e12e065471 INSERT INTO t1 VALUES (?) 1 1 0 0 2bfe58b981242b825ff30e0a23610c01 INSERT INTO t2 VALUES (?) 1 1 0 0 7dffbc5052092965f9d2739569afbb89 INSERT INTO t3 VALUES (...) 1 1 0 0 22d4d66694b4eaffa0b2037d9312aae0 INSERT INTO t4 VALUES (...) 1 1 0 0 d8b582fde31cf51cd5d0ee4e565c5eee INSERT INTO t5 VALUES (...) 1 1 0 0 c45c72afb3fbdbec45f98072a4ecf6f5 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 9a49ff059861b8b0fac613a205c80fcd INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 bb9851b80e774365eadd37ae7e6efb7f INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 f130568315c6ad1d3e9804f1877b5f1e SELECT ? + ? 3 0 0 0 6de2f55944526286ad0a812d0c546851 SELECT ? 1 0 0 0 00c7b29a063ecaa8b0986db7fb2226a8 CREATE SCHEMA statements_digest_temp 2 2 0 0 ab15c731548dc40ff43f9bff0ad94c80 DROP SCHEMA statements_digest_temp 2 0 0 0 42f722a57efba27876a0124a5be1ab5b SELECT ? FROM t11 1 0 0 1 d98c529e915c29f2244a14921a990335 CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1 dc1241f077d462bb4d6d096b0e7b2b1a INSERT INTO t11 VALUES (?) 1 1 1 0 043fc5cdadb7f0300fc8e9c83d768f13 SHOW WARNINGS 1 0 0 0 #################################### # CLEANUP #################################### DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t3; DROP TABLE IF EXISTS t4; DROP TABLE IF EXISTS t5; DROP DATABASE IF EXISTS statements_digest;