File: log_slow_innodb.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (113 lines) | stat: -rw-r--r-- 3,131 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
# Test the extended slow query log output format for various log_slow_verbosity values.
# Test that InnoDB stats for the extended slow query log are collected.
#
# This test file is based on tests from Percona server
#

--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/log_slow_prepare.inc
# Cannot be used with view protocol as number of temporary tables changes
--source include/no_view_protocol.inc

--let $log_slow_prefix=log_slow_innodb

# Force cold buffer pool
#--let $restart_parameters=--innodb_buffer_pool_load_at_startup=OFF
#--source include/restart_mysqld.inc

CREATE TABLE t1(a INT primary key, b int) ENGINE=InnoDB;
INSERT INTO t1 select seq, seq from seq_1_to_1000;

SET SESSION min_examined_row_limit=0;
SET SESSION long_query_time=0;

#
# Test all enabled options with InnoDB-involving query
#
SET SESSION log_slow_verbosity='innodb,query_plan';
--let log_file=$log_slow_prefix-verbosity_1

--source include/log_slow_start.inc
--disable_cursor_protocol
--disable_ps2_protocol
SELECT sum(a+b) FROM t1;
--enable_ps2_protocol
--enable_cursor_protocol
UPDATE t1 set b=b+1 where a=1 or a=999;
--source include/log_slow_stop.inc

--let log_slow_verbosity_expected_matches= 3
--let log_slow_verbosity_queryplan_matches= 1
--let log_slow_verbosity_innodb_expected_matches= 2
--let log_slow_verbosity_tmptable_expected_matches= 0
--source include/log_slow_grep.inc

#
# Test for "No InnoDB statistics available" in output when InnoDB stats are requested
# but the query does not involve InnoDB tables
#

SET SESSION log_slow_verbosity='innodb,query_plan';
--let log_file=$log_slow_prefix-verbosity_2

--source include/log_slow_start.inc
--disable_cursor_protocol
--disable_ps2_protocol
SELECT 1;
--enable_ps2_protocol
--enable_cursor_protocol
--source include/log_slow_stop.inc

--let log_slow_verbosity_expected_matches= 2
--let log_slow_verbosity_queryplan_matches= 1
--let log_slow_verbosity_innodb_expected_matches= 0
--source include/log_slow_grep.inc

--echo #
--echo # Test 'query_plan'
--echo #

SET SESSION log_slow_verbosity='query_plan';
--let log_file=$log_slow_prefix-verbosity_3

--source include/log_slow_start.inc
INSERT INTO t1 VALUE(1001,1001);
--source include/log_slow_stop.inc

--let log_slow_verbosity_innodb_expected_matches= 0
--source include/log_slow_grep.inc

DROP TABLE t1;

--echo #
--echo # Test max_tmp_disk_space_used
--echo #

CREATE TABLE t1(a INT primary key, c varchar(1024)) ENGINE=InnoDB;
insert into t1 select seq, concat(repeat(char(65+mod(seq,61)),32),repeat(char(65+mod(seq,59)),32)) from seq_1_to_1000;

SET SESSION log_slow_verbosity='query_plan';
SET SESSION sort_buffer_size=16384;
SET SESSION long_query_time=0;
--let log_file=$log_slow_prefix-verbosity_4

--disable_ps_protocol
--source include/log_slow_start.inc
SELECT c, count(*) from t1 group by c order by 2 limit 700,10;
--source include/log_slow_stop.inc
--enable_ps_protocol

--let grep_pattern = ^# Max_tmp_disk_space_used.*

--let log_expected_matches= 1
--source include/log_grep.inc

drop table t1;

--echo #
--echo # Cleanup
--echo #

--source include/log_slow_cleanup.inc