Debian Codegraph @

mysql-test/suite/perfschema/t/statement_digest_query_sample_short_text.test

raw
1 ####################################################
2 # WL#9830 - PERFORMANCE_SCHEMA DIGEST QUERY SAMPLE #
3 ####################################################
4 # #
5 # Test Author - Mohit Joshi #
6 # Creation date - 18-Aug-2017 #
7 ####################################################
8
9 --source include/no_protocol.inc
10 --echo
11 --echo #### Test 1 - VERIFY QUERY_SAMPLE_TEXT LENGTH IS LIMITED BY PERFORMANCE_SCHEMA_MAX_SQL_TEXT_LENGTH
12 --echo
13
14 --echo
15 --echo # 1.1 Verify sql text length = 10
16 SELECT @@global.performance_schema_max_sql_text_length;
17 --echo
18
19 USE test;
20 --disable_warnings
21 DROP TABLE IF EXISTS t1;
22 --enable_warnings
23 CREATE TABLE t1 (s1 int);
24 INSERT INTO t1 values (100), (200), (300);
25 TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
26 UPDATE t1 SET s1 = 500;
27
28 --echo
29 --echo ## 1.2 Verify that QUERY_SAMPLE_TEXT is truncated to 10 bytes
30 --echo
31 SELECT length(query_sample_text) = 10 AS 'Expect 1 as QUERY_SAMPLE_TEXT is 10'
32 FROM performance_schema.events_statements_summary_by_digest
33 WHERE digest_text = "UPDATE `t1` SET `s1` = ?";
34
35 --echo
36 --echo ## CLEANUP
37 --echo
38 DROP TABLE t1;