Merge lp:~laurynas-biveinis/percona-server/slow-log-fixes-5.5 into lp:percona-server/5.5
- slow-log-fixes-5.5
- Merge into 5.5
Proposed by
Laurynas Biveinis
Status: | Merged |
---|---|
Approved by: | Stewart Smith |
Approved revision: | no longer in the source branch. |
Merged at revision: | 438 |
Proposed branch: | lp:~laurynas-biveinis/percona-server/slow-log-fixes-5.5 |
Merge into: | lp:percona-server/5.5 |
Diff against target: |
3690 lines (+1002/-1194) 55 files modified
Percona-Server/mysql-test/include/log_cleanup.inc (+1/-0) Percona-Server/mysql-test/include/log_start.inc (+0/-16) Percona-Server/mysql-test/include/log_stop.inc (+0/-7) Percona-Server/mysql-test/include/percona_slow_extended_error_on_quit.inc (+0/-50) Percona-Server/mysql-test/include/percona_slow_log_verbosity_grep.inc (+26/-0) Percona-Server/mysql-test/include/percona_slow_query_log_rate.inc (+5/-10) Percona-Server/mysql-test/r/mysqld--help-notwin.result (+2/-2) Percona-Server/mysql-test/r/percona_bug643149.result (+0/-21) Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result (+0/-35) Percona-Server/mysql-test/r/percona_log_slow_filter.result (+0/-16) Percona-Server/mysql-test/r/percona_log_slow_innodb.result (+42/-0) Percona-Server/mysql-test/r/percona_log_slow_query_plan.result (+268/-0) Percona-Server/mysql-test/r/percona_log_slow_query_plan_qc.result (+46/-0) Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result (+0/-19) Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result (+0/-45) Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result (+0/-25) Percona-Server/mysql-test/r/percona_log_slow_verbosity.result (+0/-16) Percona-Server/mysql-test/r/percona_long_query_time.result (+0/-33) Percona-Server/mysql-test/r/percona_min_examined_row_limit.result (+1/-1) Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result (+23/-168) Percona-Server/mysql-test/r/percona_slow_extended_log_error.result (+0/-10) Percona-Server/mysql-test/r/percona_slow_query_log_rate.result (+45/-69) Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result (+0/-41) Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result (+0/-18) Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result (+0/-18) Percona-Server/mysql-test/t/disabled.def (+1/-0) Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test (+0/-20) Percona-Server/mysql-test/t/percona_log_slow_filter.test (+0/-26) Percona-Server/mysql-test/t/percona_log_slow_innodb.test (+82/-0) Percona-Server/mysql-test/t/percona_log_slow_query_plan.test (+302/-0) Percona-Server/mysql-test/t/percona_log_slow_query_plan_qc.test (+71/-0) Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb-slave.opt (+0/-1) Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test (+0/-42) Percona-Server/mysql-test/t/percona_log_slow_slave_statements-slave.opt (+0/-1) Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test (+0/-117) Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test (+0/-29) Percona-Server/mysql-test/t/percona_log_slow_verbosity.test (+0/-19) Percona-Server/mysql-test/t/percona_long_query_time.test (+0/-25) Percona-Server/mysql-test/t/percona_min_examined_row_limit.test (+0/-35) Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test (+0/-87) Percona-Server/mysql-test/t/percona_slow_extended_log_error.test (+0/-15) Percona-Server/mysql-test/t/percona_slow_query_log_rate.test (+10/-3) Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test (+0/-34) Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test (+0/-25) Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test (+0/-28) Percona-Server/sql/event_scheduler.cc (+0/-1) Percona-Server/sql/log.cc (+49/-23) Percona-Server/sql/log_event.cc (+1/-1) Percona-Server/sql/slave.cc (+1/-2) Percona-Server/sql/sql_class.cc (+0/-5) Percona-Server/sql/sql_class.h (+8/-20) Percona-Server/sql/sql_connect.cc (+0/-8) Percona-Server/sql/sql_parse.cc (+15/-5) Percona-Server/sql/sys_vars.cc (+2/-1) Percona-Server/storage/innobase/handler/ha_innodb.cc (+1/-1) |
To merge this branch: | bzr merge lp:~laurynas-biveinis/percona-server/slow-log-fixes-5.5 |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stewart Smith (community) | Approve | ||
Review via email: mp+144058@code.launchpad.net |
Commit message
Description of the change
Merge multiple slow query log fixes from 5.1.
http://
To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'Percona-Server/mysql-test/include/log_cleanup.inc' | |||
2 | --- Percona-Server/mysql-test/include/log_cleanup.inc 1970-01-01 00:00:00 +0000 | |||
3 | +++ Percona-Server/mysql-test/include/log_cleanup.inc 2013-01-21 06:27:51 +0000 | |||
4 | @@ -0,0 +1,1 @@ | |||
5 | 1 | --remove_files_wildcard $MYSQLTEST_VARDIR *.slog | ||
6 | 0 | 2 | ||
7 | === added file 'Percona-Server/mysql-test/include/log_start.inc' | |||
8 | --- Percona-Server/mysql-test/include/log_start.inc 1970-01-01 00:00:00 +0000 | |||
9 | +++ Percona-Server/mysql-test/include/log_start.inc 2013-01-21 06:27:51 +0000 | |||
10 | @@ -0,0 +1,11 @@ | |||
11 | 1 | --let slow_query_log_file_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log_file';` | ||
12 | 2 | --let slow_query_log_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log';` | ||
13 | 3 | --let log_output_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'log_output';` | ||
14 | 4 | --disable_query_log | ||
15 | 5 | --let log_file_full_path = $MYSQLTEST_VARDIR/$log_file.slog | ||
16 | 6 | SET GLOBAL slow_query_log=0; | ||
17 | 7 | SET GLOBAL log_output=FILE; | ||
18 | 8 | --echo [log_start.inc] $log_file | ||
19 | 9 | EVAL SET GLOBAL slow_query_log_file="$log_file_full_path"; | ||
20 | 10 | SET GLOBAL slow_query_log=1; | ||
21 | 11 | --enable_query_log | ||
22 | 0 | 12 | ||
23 | === removed file 'Percona-Server/mysql-test/include/log_start.inc' | |||
24 | --- Percona-Server/mysql-test/include/log_start.inc 2012-04-18 23:25:38 +0000 | |||
25 | +++ Percona-Server/mysql-test/include/log_start.inc 1970-01-01 00:00:00 +0000 | |||
26 | @@ -1,16 +0,0 @@ | |||
27 | 1 | --disable_query_log | ||
28 | 2 | --let log_file_full_path = $MYSQLTEST_VARDIR/$log_file | ||
29 | 3 | SET @slow_query_log_old=@@slow_query_log; | ||
30 | 4 | SET @slow_query_log_file_old= @@slow_query_log_file; | ||
31 | 5 | SET GLOBAL slow_query_log=OFF; | ||
32 | 6 | perl; | ||
33 | 7 | $log_file_full_path= $ENV{'log_file_full_path'}; | ||
34 | 8 | unlink $log_file_full_path; | ||
35 | 9 | open(FILE, '>', $log_file_full_path) | ||
36 | 10 | or die "Cannot create log file $log_file_full_path, reason: $!"; | ||
37 | 11 | close(FILE); | ||
38 | 12 | EOF | ||
39 | 13 | --echo [log_start.inc] $log_file | ||
40 | 14 | EVAL SET GLOBAL slow_query_log_file="$log_file_full_path"; | ||
41 | 15 | SET GLOBAL slow_query_log=ON; | ||
42 | 16 | --enable_query_log | ||
43 | 17 | 0 | ||
44 | === added file 'Percona-Server/mysql-test/include/log_stop.inc' | |||
45 | --- Percona-Server/mysql-test/include/log_stop.inc 1970-01-01 00:00:00 +0000 | |||
46 | +++ Percona-Server/mysql-test/include/log_stop.inc 2013-01-21 06:27:51 +0000 | |||
47 | @@ -0,0 +1,7 @@ | |||
48 | 1 | --disable_query_log | ||
49 | 2 | SET GLOBAL slow_query_log=0; | ||
50 | 3 | --echo [log_stop.inc] $log_file | ||
51 | 4 | EVAL SET GLOBAL log_output= $log_output_old; | ||
52 | 5 | EVAL SET GLOBAL slow_query_log_file= "$slow_query_log_file_old"; | ||
53 | 6 | EVAL SET GLOBAL slow_query_log= $slow_query_log_old; | ||
54 | 7 | --enable_query_log | ||
55 | 0 | 8 | ||
56 | === removed file 'Percona-Server/mysql-test/include/log_stop.inc' | |||
57 | --- Percona-Server/mysql-test/include/log_stop.inc 2012-04-18 23:25:38 +0000 | |||
58 | +++ Percona-Server/mysql-test/include/log_stop.inc 1970-01-01 00:00:00 +0000 | |||
59 | @@ -1,7 +0,0 @@ | |||
60 | 1 | --disable_query_log | ||
61 | 2 | FLUSH LOGS; | ||
62 | 3 | SET GLOBAL slow_query_log=OFF; | ||
63 | 4 | --echo [log_stop.inc] $log_file | ||
64 | 5 | SET GLOBAL slow_query_log_file= @slow_query_log_file_old; | ||
65 | 6 | SET GLOBAL slow_query_log= @slow_query_log_old; | ||
66 | 7 | --enable_query_log | ||
67 | 8 | 0 | ||
68 | === removed file 'Percona-Server/mysql-test/include/percona_slow_extended_error_on_quit.inc' | |||
69 | --- Percona-Server/mysql-test/include/percona_slow_extended_error_on_quit.inc 2012-10-27 05:16:07 +0000 | |||
70 | +++ Percona-Server/mysql-test/include/percona_slow_extended_error_on_quit.inc 1970-01-01 00:00:00 +0000 | |||
71 | @@ -1,50 +0,0 @@ | |||
72 | 1 | --echo ################################################################################ | ||
73 | 2 | --let grep_pattern=CREATE | ||
74 | 3 | --source include/log_grep.inc | ||
75 | 4 | --let grep_pattern=INSERT | ||
76 | 5 | --source include/log_grep.inc | ||
77 | 6 | --let grep_pattern=SELECT | ||
78 | 7 | --source include/log_grep.inc | ||
79 | 8 | --let grep_pattern=Quit | ||
80 | 9 | --source include/log_grep.inc | ||
81 | 10 | --let grep_pattern=Last_errno: [^0]+ | ||
82 | 11 | --source include/log_grep.inc | ||
83 | 12 | --let grep_pattern=Last_errno: 0 | ||
84 | 13 | --source include/log_grep.inc | ||
85 | 14 | --let grep_pattern=Rows_sent: [^0]+ | ||
86 | 15 | --source include/log_grep.inc | ||
87 | 16 | --let grep_pattern=Rows_sent: 0 | ||
88 | 17 | --source include/log_grep.inc | ||
89 | 18 | --let grep_pattern=Rows_examined: [^0]+ | ||
90 | 19 | --source include/log_grep.inc | ||
91 | 20 | --let grep_pattern=Rows_examined: 0 | ||
92 | 21 | --source include/log_grep.inc | ||
93 | 22 | --let grep_pattern=Rows_affected: [^0]+ | ||
94 | 23 | --source include/log_grep.inc | ||
95 | 24 | --let grep_pattern=Rows_affected: 0 | ||
96 | 25 | --source include/log_grep.inc | ||
97 | 26 | --let grep_pattern=Rows_read: [^0]+ | ||
98 | 27 | --source include/log_grep.inc | ||
99 | 28 | --let grep_pattern=Rows_read: 0 | ||
100 | 29 | --source include/log_grep.inc | ||
101 | 30 | --let grep_pattern=Bytes_sent: [^0]+ | ||
102 | 31 | --source include/log_grep.inc | ||
103 | 32 | --let grep_pattern=Bytes_sent: 0 | ||
104 | 33 | --source include/log_grep.inc | ||
105 | 34 | --let grep_pattern=Tmp_tables: [^0]+ | ||
106 | 35 | --source include/log_grep.inc | ||
107 | 36 | --let grep_pattern=Tmp_tables: 0 | ||
108 | 37 | --source include/log_grep.inc | ||
109 | 38 | --let grep_pattern=Tmp_disk_tables: [^0]+ | ||
110 | 39 | --source include/log_grep.inc | ||
111 | 40 | --let grep_pattern=Tmp_disk_tables: 0 | ||
112 | 41 | --source include/log_grep.inc | ||
113 | 42 | --let grep_pattern=Tmp_table_sizes: [^0]+ | ||
114 | 43 | --source include/log_grep.inc | ||
115 | 44 | --let grep_pattern=Tmp_table_sizes: 0 | ||
116 | 45 | --source include/log_grep.inc | ||
117 | 46 | --let grep_pattern=# No InnoDB statistics available for this query | ||
118 | 47 | --source include/log_grep.inc | ||
119 | 48 | --let grep_pattern=# InnoDB_trx_id: | ||
120 | 49 | --source include/log_grep.inc | ||
121 | 50 | --echo ################################################################################ | ||
122 | 51 | 0 | ||
123 | === added file 'Percona-Server/mysql-test/include/percona_slow_log_verbosity_grep.inc' | |||
124 | --- Percona-Server/mysql-test/include/percona_slow_log_verbosity_grep.inc 1970-01-01 00:00:00 +0000 | |||
125 | +++ Percona-Server/mysql-test/include/percona_slow_log_verbosity_grep.inc 2013-01-21 06:27:51 +0000 | |||
126 | @@ -0,0 +1,26 @@ | |||
127 | 1 | # Common extensions to the slow query log | ||
128 | 2 | --let grep_pattern = ^# Thread_id: \d+ Schema: .+ Last_errno: \d+ Killed: \d+\$ | ||
129 | 3 | --source include/log_grep.inc | ||
130 | 4 | --let grep_pattern = ^#.*Rows_affected: \d+ Rows_read: \d+\$ | ||
131 | 5 | --source include/log_grep.inc | ||
132 | 6 | --let grep_pattern = ^# Bytes_sent: \d+.*\$ | ||
133 | 7 | --source include/log_grep.inc | ||
134 | 8 | # InnoDB | ||
135 | 9 | --let grep_pattern = ^# InnoDB_trx_id: \w+\$ | ||
136 | 10 | --source include/log_grep.inc | ||
137 | 11 | # Query plan | ||
138 | 12 | --let grep_pattern = ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+\$ | ||
139 | 13 | --source include/log_grep.inc | ||
140 | 14 | --let grep_pattern = ^# QC_Hit: (Yes|No) Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)\$ | ||
141 | 15 | --source include/log_grep.inc | ||
142 | 16 | --let grep_pattern = ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+\$ | ||
143 | 17 | --source include/log_grep.inc | ||
144 | 18 | # InnoDB | ||
145 | 19 | --let grep_pattern = ^# InnoDB_IO_r_ops: \d+ InnoDB_IO_r_bytes: \d+ InnoDB_IO_r_wait: \d*\.\d*\$ | ||
146 | 20 | --source include/log_grep.inc | ||
147 | 21 | --let grep_pattern = ^# InnoDB_rec_lock_wait: \d*\.\d* InnoDB_queue_wait: \d*\.\d*\$ | ||
148 | 22 | --source include/log_grep.inc | ||
149 | 23 | --let grep_pattern = ^# InnoDB_pages_distinct: \d+\$ | ||
150 | 24 | --source include/log_grep.inc | ||
151 | 25 | --let grep_pattern = ^# No InnoDB statistics available for this query\$ | ||
152 | 26 | --source include/log_grep.inc | ||
153 | 0 | 27 | ||
154 | === modified file 'Percona-Server/mysql-test/include/percona_slow_query_log_rate.inc' | |||
155 | --- Percona-Server/mysql-test/include/percona_slow_query_log_rate.inc 2012-04-18 23:25:38 +0000 | |||
156 | +++ Percona-Server/mysql-test/include/percona_slow_query_log_rate.inc 2013-01-21 06:27:51 +0000 | |||
157 | @@ -1,31 +1,26 @@ | |||
158 | 1 | --let wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST; | ||
159 | 2 | --connection default | 1 | --connection default |
160 | 3 | --source include/log_start.inc | ||
161 | 4 | 2 | ||
162 | 3 | --source include/count_sessions.inc | ||
163 | 5 | --connect (connection_one,localhost,root,,) | 4 | --connect (connection_one,localhost,root,,) |
164 | 6 | --connect (connection_two,localhost,root,,) | 5 | --connect (connection_two,localhost,root,,) |
165 | 7 | --connect (connection_three,localhost,root,,) | 6 | --connect (connection_three,localhost,root,,) |
166 | 8 | 7 | ||
167 | 8 | --source include/log_start.inc | ||
168 | 9 | |||
169 | 9 | --let i=2 | 10 | --let i=2 |
170 | 10 | --let k=1 | 11 | --let k=1 |
171 | 11 | 12 | ||
172 | 12 | while($i) | 13 | while($i) |
173 | 13 | { | 14 | { |
174 | 14 | --connection connection_one | 15 | --connection connection_one |
175 | 15 | SET SESSION query_exec_time=1.1; | ||
176 | 16 | eval SET SESSION query_exec_id=$k; | ||
177 | 17 | inc $k; | 16 | inc $k; |
178 | 18 | SELECT 'connection_one'; | 17 | SELECT 'connection_one'; |
179 | 19 | 18 | ||
180 | 20 | --connection connection_two | 19 | --connection connection_two |
181 | 21 | SET SESSION query_exec_time=1.1; | ||
182 | 22 | eval SET SESSION query_exec_id=$k; | ||
183 | 23 | inc $k; | 20 | inc $k; |
184 | 24 | SELECT 'connection_two'; | 21 | SELECT 'connection_two'; |
185 | 25 | 22 | ||
186 | 26 | --connection connection_three | 23 | --connection connection_three |
187 | 27 | SET SESSION query_exec_time=1.1; | ||
188 | 28 | eval SET SESSION query_exec_id=$k; | ||
189 | 29 | inc $k; | 24 | inc $k; |
190 | 30 | SELECT 'connection_three'; | 25 | SELECT 'connection_three'; |
191 | 31 | 26 | ||
192 | @@ -33,10 +28,10 @@ | |||
193 | 33 | } | 28 | } |
194 | 34 | 29 | ||
195 | 35 | --connection default | 30 | --connection default |
196 | 31 | --source include/log_stop.inc | ||
197 | 36 | --disconnect connection_one | 32 | --disconnect connection_one |
198 | 37 | --disconnect connection_two | 33 | --disconnect connection_two |
199 | 38 | --disconnect connection_three | 34 | --disconnect connection_three |
202 | 39 | --source include/wait_condition.inc | 35 | --source include/wait_until_count_sessions.inc |
201 | 40 | --source include/log_stop.inc | ||
203 | 41 | --let log_slow_rate_test=1 | 36 | --let log_slow_rate_test=1 |
204 | 42 | --source include/log_grep.inc | 37 | --source include/log_grep.inc |
205 | 43 | 38 | ||
206 | === modified file 'Percona-Server/mysql-test/r/mysqld--help-notwin.result' | |||
207 | --- Percona-Server/mysql-test/r/mysqld--help-notwin.result 2012-09-28 01:36:45 +0000 | |||
208 | +++ Percona-Server/mysql-test/r/mysqld--help-notwin.result 2013-01-21 06:27:51 +0000 | |||
209 | @@ -719,8 +719,8 @@ | |||
210 | 719 | Timestamp is printed for all records of the slow log even | 719 | Timestamp is printed for all records of the slow log even |
211 | 720 | if they are same time. | 720 | if they are same time. |
212 | 721 | --slow-query-log-timestamp-precision=name | 721 | --slow-query-log-timestamp-precision=name |
215 | 722 | Log slow statements executed by stored procedure to the | 722 | Select the timestamp precision for use in the slow query |
216 | 723 | slow log if it is open. [second, microsecond] | 723 | log. [second, microsecond] |
217 | 724 | --slow-query-log-use-global-control=name | 724 | --slow-query-log-use-global-control=name |
218 | 725 | Choose flags, wich always use the global variables. | 725 | Choose flags, wich always use the global variables. |
219 | 726 | Multiple flags allowed in a comma-separated string. | 726 | Multiple flags allowed in a comma-separated string. |
220 | 727 | 727 | ||
221 | === added file 'Percona-Server/mysql-test/r/percona_bug643149.result' | |||
222 | --- Percona-Server/mysql-test/r/percona_bug643149.result 1970-01-01 00:00:00 +0000 | |||
223 | +++ Percona-Server/mysql-test/r/percona_bug643149.result 2013-01-21 06:27:51 +0000 | |||
224 | @@ -0,0 +1,21 @@ | |||
225 | 1 | SET @old_slow_query_log_file=@@global.slow_query_log_file; | ||
226 | 2 | SET GLOBAL slow_query_log=on; | ||
227 | 3 | SET LOCAL log_slow_verbosity='profiling'; | ||
228 | 4 | SET LOCAL long_query_time=0; | ||
229 | 5 | SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug643149_slow.log';; | ||
230 | 6 | SELECT 1; | ||
231 | 7 | 1 | ||
232 | 8 | 1 | ||
233 | 9 | # User@Host: root[root] @ localhost [] | ||
234 | 10 | # Thread_id: X Schema: test Last_errno: X Killed: X | ||
235 | 11 | # Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X | ||
236 | 12 | # Bytes_sent: X | ||
237 | 13 | # Profile_starting: X.X Profile_starting_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X | ||
238 | 14 | # Profile_total: X.X Profile_total_cpu: X.X | ||
239 | 15 | # User@Host: root[root] @ localhost [] | ||
240 | 16 | # Thread_id: X Schema: test Last_errno: X Killed: X | ||
241 | 17 | # Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X | ||
242 | 18 | # Bytes_sent: X | ||
243 | 19 | # Profile_starting: X.X Profile_starting_cpu: X.X Profile_checking_permissions: X.X Profile_checking_permissions_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_init: X.X Profile_init_cpu: X.X Profile_optimizing: X.X Profile_optimizing_cpu: X.X Profile_executing: X.X Profile_executing_cpu: X.X Profile_end: X.X Profile_end_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X | ||
244 | 20 | # Profile_total: X.X Profile_total_cpu: X.X | ||
245 | 21 | SET GLOBAL slow_query_log_file=@old_slow_query_log_file; | ||
246 | 0 | 22 | ||
247 | === removed file 'Percona-Server/mysql-test/r/percona_bug643149.result' | |||
248 | --- Percona-Server/mysql-test/r/percona_bug643149.result 2012-04-18 23:25:38 +0000 | |||
249 | +++ Percona-Server/mysql-test/r/percona_bug643149.result 1970-01-01 00:00:00 +0000 | |||
250 | @@ -1,21 +0,0 @@ | |||
251 | 1 | SET @old_slow_query_log_file=@@global.slow_query_log_file; | ||
252 | 2 | SET GLOBAL slow_query_log=on; | ||
253 | 3 | SET LOCAL log_slow_verbosity='profiling'; | ||
254 | 4 | SET LOCAL long_query_time=0; | ||
255 | 5 | SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug643149_slow.log';; | ||
256 | 6 | SELECT 1; | ||
257 | 7 | 1 | ||
258 | 8 | 1 | ||
259 | 9 | # User@Host: root[root] @ localhost [] | ||
260 | 10 | # Thread_id: X Schema: test Last_errno: X Killed: X | ||
261 | 11 | # Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X | ||
262 | 12 | # Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X | ||
263 | 13 | # Profile_starting: X.X Profile_starting_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X | ||
264 | 14 | # Profile_total: X.X Profile_total_cpu: X.X | ||
265 | 15 | # User@Host: root[root] @ localhost [] | ||
266 | 16 | # Thread_id: X Schema: test Last_errno: X Killed: X | ||
267 | 17 | # Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X | ||
268 | 18 | # Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X | ||
269 | 19 | # Profile_starting: X.X Profile_starting_cpu: X.X Profile_checking_permissions: X.X Profile_checking_permissions_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_init: X.X Profile_init_cpu: X.X Profile_optimizing: X.X Profile_optimizing_cpu: X.X Profile_executing: X.X Profile_executing_cpu: X.X Profile_end: X.X Profile_end_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X | ||
270 | 20 | # Profile_total: X.X Profile_total_cpu: X.X | ||
271 | 21 | SET GLOBAL slow_query_log_file=@old_slow_query_log_file; | ||
272 | 22 | 0 | ||
273 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result' | |||
274 | --- Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result 1970-01-01 00:00:00 +0000 | |||
275 | +++ Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result 2013-01-21 06:27:51 +0000 | |||
276 | @@ -0,0 +1,20 @@ | |||
277 | 1 | DROP TABLE IF EXISTS t1; | ||
278 | 2 | CREATE TABLE t1 (a INT); | ||
279 | 3 | SET SESSION min_examined_row_limit=0; | ||
280 | 4 | SET SESSION long_query_time=0; | ||
281 | 5 | SET GLOBAL log_slow_admin_statements=ON; | ||
282 | 6 | [log_start.inc] percona_log_slow_admin_stmt_1 | ||
283 | 7 | ALTER TABLE t1 ADD INDEX a(a); | ||
284 | 8 | [log_stop.inc] percona_log_slow_admin_stmt_1 | ||
285 | 9 | [log_grep.inc] file: percona_log_slow_admin_stmt_1 pattern: ALTER TABLE t1 ADD INDEX a\(a\); | ||
286 | 10 | [log_grep.inc] lines: 1 | ||
287 | 11 | SET GLOBAL log_slow_admin_statements=OFF; | ||
288 | 12 | [log_start.inc] percona_log_slow_admin_stmt_2 | ||
289 | 13 | ALTER TABLE t1 DROP INDEX a; | ||
290 | 14 | [log_stop.inc] percona_log_slow_admin_stmt_2 | ||
291 | 15 | [log_grep.inc] file: percona_log_slow_admin_stmt_2 pattern: ALTER TABLE t1 DROP INDEX a; | ||
292 | 16 | [log_grep.inc] lines: 0 | ||
293 | 17 | SET GLOBAL log_slow_admin_statements=default; | ||
294 | 18 | SET SESSION long_query_time=default; | ||
295 | 19 | SET SESSION min_examined_row_limit=default; | ||
296 | 20 | DROP TABLE t1; | ||
297 | 0 | 21 | ||
298 | === removed file 'Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result' | |||
299 | --- Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result 2012-04-18 23:25:38 +0000 | |||
300 | +++ Percona-Server/mysql-test/r/percona_log_slow_admin_statements.result 1970-01-01 00:00:00 +0000 | |||
301 | @@ -1,35 +0,0 @@ | |||
302 | 1 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
303 | 2 | Variable_name Value | ||
304 | 3 | log_slow_admin_statements OFF | ||
305 | 4 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
306 | 5 | VARIABLE_NAME VARIABLE_VALUE | ||
307 | 6 | LOG_SLOW_ADMIN_STATEMENTS OFF | ||
308 | 7 | SET GLOBAL log_slow_admin_statements=true; | ||
309 | 8 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
310 | 9 | Variable_name Value | ||
311 | 10 | log_slow_admin_statements ON | ||
312 | 11 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
313 | 12 | VARIABLE_NAME VARIABLE_VALUE | ||
314 | 13 | LOG_SLOW_ADMIN_STATEMENTS ON | ||
315 | 14 | SET GLOBAL log_slow_admin_statements=false; | ||
316 | 15 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
317 | 16 | Variable_name Value | ||
318 | 17 | log_slow_admin_statements OFF | ||
319 | 18 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
320 | 19 | VARIABLE_NAME VARIABLE_VALUE | ||
321 | 20 | LOG_SLOW_ADMIN_STATEMENTS OFF | ||
322 | 21 | SET GLOBAL log_slow_admin_statements=foo; | ||
323 | 22 | ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of 'foo' | ||
324 | 23 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
325 | 24 | Variable_name Value | ||
326 | 25 | log_slow_admin_statements OFF | ||
327 | 26 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
328 | 27 | VARIABLE_NAME VARIABLE_VALUE | ||
329 | 28 | LOG_SLOW_ADMIN_STATEMENTS OFF | ||
330 | 29 | SET GLOBAL log_slow_admin_statements=default; | ||
331 | 30 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
332 | 31 | Variable_name Value | ||
333 | 32 | log_slow_admin_statements OFF | ||
334 | 33 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
335 | 34 | VARIABLE_NAME VARIABLE_VALUE | ||
336 | 35 | LOG_SLOW_ADMIN_STATEMENTS OFF | ||
337 | 36 | 0 | ||
338 | === removed file 'Percona-Server/mysql-test/r/percona_log_slow_filter.result' | |||
339 | --- Percona-Server/mysql-test/r/percona_log_slow_filter.result 2012-04-18 23:25:38 +0000 | |||
340 | +++ Percona-Server/mysql-test/r/percona_log_slow_filter.result 1970-01-01 00:00:00 +0000 | |||
341 | @@ -1,16 +0,0 @@ | |||
342 | 1 | CREATE TABLE t(id INT PRIMARY KEY); | ||
343 | 2 | INSERT INTO t VALUES(1); | ||
344 | 3 | INSERT INTO t VALUES(2); | ||
345 | 4 | INSERT INTO t VALUES(3); | ||
346 | 5 | SET long_query_time=1; | ||
347 | 6 | SET log_slow_filter=full_join; | ||
348 | 7 | [log_start.inc] percona.slow_extended.log_slow_filter | ||
349 | 8 | SET query_exec_time = 1.1; | ||
350 | 9 | SELECT * FROM t AS t1, t AS t2; | ||
351 | 10 | SET query_exec_time = default; | ||
352 | 11 | [log_stop.inc] percona.slow_extended.log_slow_filter | ||
353 | 12 | SET log_slow_filter=default; | ||
354 | 13 | SET long_query_time=default; | ||
355 | 14 | [log_grep.inc] file: percona.slow_extended.log_slow_filter pattern: Query_time | ||
356 | 15 | [log_grep.inc] lines: 1 | ||
357 | 16 | DROP TABLE t; | ||
358 | 17 | 0 | ||
359 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_innodb.result' | |||
360 | --- Percona-Server/mysql-test/r/percona_log_slow_innodb.result 1970-01-01 00:00:00 +0000 | |||
361 | +++ Percona-Server/mysql-test/r/percona_log_slow_innodb.result 2013-01-21 06:27:51 +0000 | |||
362 | @@ -0,0 +1,42 @@ | |||
363 | 1 | DROP TABLE IF EXISTS t1, t2; | ||
364 | 2 | CREATE TABLE t1(a INT) ENGINE=InnoDB; | ||
365 | 3 | INSERT INTO t1 VALUE(1); | ||
366 | 4 | CREATE TABLE t2(a INT) ENGINE=InnoDB; | ||
367 | 5 | INSERT INTO t2 VALUE(1); | ||
368 | 6 | SET SESSION min_examined_row_limit=0; | ||
369 | 7 | SET SESSION long_query_time=0; | ||
370 | 8 | SET @old_log_slow_verbosity := @@log_slow_verbosity; | ||
371 | 9 | SET SESSION log_slow_verbosity='microtime,innodb'; | ||
372 | 10 | [log_start.inc] percona.slow_extended.innodb_0 | ||
373 | 11 | INSERT INTO t1 VALUES(2); | ||
374 | 12 | INSERT INTO t2 VALUES(2); | ||
375 | 13 | INSERT INTO t1 VALUES(3); | ||
376 | 14 | SELECT 5; | ||
377 | 15 | 5 | ||
378 | 16 | 5 | ||
379 | 17 | [log_stop.inc] percona.slow_extended.innodb_0 | ||
380 | 18 | LOCK TABLE t1 WRITE; | ||
381 | 19 | [log_start.inc] percona.slow_extended.innodb_3 | ||
382 | 20 | LOCK TABLE t1 WRITE; | ||
383 | 21 | SELECT SLEEP(5); | ||
384 | 22 | SLEEP(5) | ||
385 | 23 | 0 | ||
386 | 24 | UNLOCK TABLES; | ||
387 | 25 | [log_stop.inc] percona.slow_extended.innodb_3 | ||
388 | 26 | UNLOCK TABLES; | ||
389 | 27 | BEGIN; | ||
390 | 28 | SELECT * FROM t2 FOR UPDATE; | ||
391 | 29 | a | ||
392 | 30 | 1 | ||
393 | 31 | 2 | ||
394 | 32 | [log_start.inc] percona.slow_extended.innodb_4 | ||
395 | 33 | DELETE FROM t2 WHERE a=2; | ||
396 | 34 | SELECT SLEEP(5); | ||
397 | 35 | SLEEP(5) | ||
398 | 36 | 0 | ||
399 | 37 | COMMIT; | ||
400 | 38 | [log_stop.inc] percona.slow_extended.innodb_4 | ||
401 | 39 | SET SESSION min_examined_row_limit=default; | ||
402 | 40 | SET SESSION long_query_time=default; | ||
403 | 41 | SET SESSION log_slow_verbosity=@old_log_slow_verbosity; | ||
404 | 42 | DROP TABLE t1, t2; | ||
405 | 0 | 43 | ||
406 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_query_plan.result' | |||
407 | --- Percona-Server/mysql-test/r/percona_log_slow_query_plan.result 1970-01-01 00:00:00 +0000 | |||
408 | +++ Percona-Server/mysql-test/r/percona_log_slow_query_plan.result 2013-01-21 06:27:51 +0000 | |||
409 | @@ -0,0 +1,268 @@ | |||
410 | 1 | FLUSH STATUS; | ||
411 | 2 | DROP TABLE IF EXISTS t1; | ||
412 | 3 | CREATE TABLE t1( | ||
413 | 4 | a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
414 | 5 | b INT) ENGINE=InnoDB; | ||
415 | 6 | INSERT INTO t1 VALUES(NULL, 10), (NULL, 5); | ||
416 | 7 | SET SESSION long_query_time=0; | ||
417 | 8 | SET SESSION min_examined_row_limit=0; | ||
418 | 9 | SET SESSION log_slow_verbosity='microtime,query_plan'; | ||
419 | 10 | EXPLAIN SELECT * FROM t1; | ||
420 | 11 | id select_type table type possible_keys key key_len ref rows Extra | ||
421 | 12 | 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 | ||
422 | 13 | [log_start.inc] percona_slow_query_log.query_plan_0 | ||
423 | 14 | SELECT * FROM t1; | ||
424 | 15 | a b | ||
425 | 16 | 1 10 | ||
426 | 17 | 2 5 | ||
427 | 18 | [log_stop.inc] percona_slow_query_log.query_plan_0 | ||
428 | 19 | [log_grep.inc] file: percona_slow_query_log.query_plan_0 pattern: ^# Filesort: No Filesort_on_disk: No Merge_passes: 0$ | ||
429 | 20 | [log_grep.inc] lines: 2 | ||
430 | 21 | EXPLAIN SELECT * FROM t1 ORDER BY b; | ||
431 | 22 | id select_type table type possible_keys key key_len ref rows Extra | ||
432 | 23 | 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using filesort | ||
433 | 24 | [log_start.inc] percona_slow_query_log.query_plan_1 | ||
434 | 25 | SELECT * FROM t1 ORDER BY b; | ||
435 | 26 | a b | ||
436 | 27 | 2 5 | ||
437 | 28 | 1 10 | ||
438 | 29 | [log_stop.inc] percona_slow_query_log.query_plan_1 | ||
439 | 30 | [log_grep.inc] file: percona_slow_query_log.query_plan_1 pattern: ^# Filesort: Yes Filesort_on_disk: No Merge_passes: 0$ | ||
440 | 31 | [log_grep.inc] lines: 1 | ||
441 | 32 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort_on_disk'; | ||
442 | 33 | [log_start.inc] percona_slow_query_log.query_plan_1a | ||
443 | 34 | SELECT * FROM t1 ORDER BY b; | ||
444 | 35 | a b | ||
445 | 36 | 2 5 | ||
446 | 37 | 1 10 | ||
447 | 38 | [log_stop.inc] percona_slow_query_log.query_plan_1a | ||
448 | 39 | [log_grep.inc] file: percona_slow_query_log.query_plan_1a pattern: ^# Filesort: Yes Filesort_on_disk: No Merge_passes: 0$ | ||
449 | 40 | [log_grep.inc] lines: 0 | ||
450 | 41 | SET SESSION log_slow_filter=default; | ||
451 | 42 | SET SESSION sort_buffer_size=32804; | ||
452 | 43 | CREATE TABLE t2 (a INT) ENGINE=InnoDB; | ||
453 | 44 | INSERT INTO t2 VALUES (5), (16), (2), (17), (1); | ||
454 | 45 | INSERT INTO t2 SELECT * FROM t2; | ||
455 | 46 | INSERT INTO t2 SELECT * FROM t2; | ||
456 | 47 | INSERT INTO t2 SELECT * FROM t2; | ||
457 | 48 | INSERT INTO t2 SELECT * FROM t2; | ||
458 | 49 | INSERT INTO t2 SELECT * FROM t2; | ||
459 | 50 | INSERT INTO t2 SELECT * FROM t2; | ||
460 | 51 | INSERT INTO t2 SELECT * FROM t2; | ||
461 | 52 | INSERT INTO t2 SELECT * FROM t2; | ||
462 | 53 | INSERT INTO t2 SELECT * FROM t2; | ||
463 | 54 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
464 | 55 | Variable_name Value | ||
465 | 56 | Sort_merge_passes 0 | ||
466 | 57 | EXPLAIN SELECT * FROM t2 ORDER BY a; | ||
467 | 58 | id select_type table type possible_keys key key_len ref rows Extra | ||
468 | 59 | 1 SIMPLE t2 ALL NULL NULL NULL NULL ROWS Using filesort | ||
469 | 60 | [log_start.inc] percona_slow_query_log.query_plan_2 | ||
470 | 61 | SELECT * FROM t2 ORDER BY a; | ||
471 | 62 | [log_stop.inc] percona_slow_query_log.query_plan_2 | ||
472 | 63 | [log_grep.inc] file: percona_slow_query_log.query_plan_2 pattern: ^# Filesort: Yes Filesort_on_disk: Yes Merge_passes: 1$ | ||
473 | 64 | [log_grep.inc] lines: 1 | ||
474 | 65 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
475 | 66 | Variable_name Value | ||
476 | 67 | Sort_merge_passes 1 | ||
477 | 68 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk'; | ||
478 | 69 | [log_start.inc] percona_slow_query_log.query_plan_2a | ||
479 | 70 | SELECT * FROM t2 ORDER BY a; | ||
480 | 71 | [log_stop.inc] percona_slow_query_log.query_plan_2a | ||
481 | 72 | [log_grep.inc] file: percona_slow_query_log.query_plan_2a pattern: ^# Filesort: Yes Filesort_on_disk: Yes Merge_passes: 1$ | ||
482 | 73 | [log_grep.inc] lines: 0 | ||
483 | 74 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
484 | 75 | Variable_name Value | ||
485 | 76 | Sort_merge_passes 2 | ||
486 | 77 | SET SESSION log_slow_filter=default; | ||
487 | 78 | INSERT INTO t2 SELECT * FROM t2; | ||
488 | 79 | INSERT INTO t2 SELECT * FROM t2; | ||
489 | 80 | INSERT INTO t2 SELECT * FROM t2; | ||
490 | 81 | INSERT INTO t2 SELECT * FROM t2; | ||
491 | 82 | [log_start.inc] percona_slow_query_log.query_plan_3 | ||
492 | 83 | SELECT * FROM t2 ORDER BY a; | ||
493 | 84 | [log_stop.inc] percona_slow_query_log.query_plan_3 | ||
494 | 85 | [log_grep.inc] file: percona_slow_query_log.query_plan_3 pattern: ^# Filesort: Yes Filesort_on_disk: Yes Merge_passes: 4$ | ||
495 | 86 | [log_grep.inc] lines: 1 | ||
496 | 87 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
497 | 88 | Variable_name Value | ||
498 | 89 | Sort_merge_passes 6 | ||
499 | 90 | SET SESSION sort_buffer_size=default; | ||
500 | 91 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
501 | 92 | Variable_name Value | ||
502 | 93 | Select_scan 37 | ||
503 | 94 | [log_start.inc] percona_slow_query_log.query_plan_4 | ||
504 | 95 | SELECT * FROM t1 WHERE a=1; | ||
505 | 96 | a b | ||
506 | 97 | 1 10 | ||
507 | 98 | [log_stop.inc] percona_slow_query_log.query_plan_4 | ||
508 | 99 | [log_grep.inc] file: percona_slow_query_log.query_plan_4 pattern: ^#.*Full_scan: No.*$ | ||
509 | 100 | [log_grep.inc] lines: 2 | ||
510 | 101 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
511 | 102 | Variable_name Value | ||
512 | 103 | Select_scan 40 | ||
513 | 104 | [log_start.inc] percona_slow_query_log.query_plan_5 | ||
514 | 105 | SELECT COUNT(*) FROM t1; | ||
515 | 106 | COUNT(*) | ||
516 | 107 | 2 | ||
517 | 108 | [log_stop.inc] percona_slow_query_log.query_plan_5 | ||
518 | 109 | [log_grep.inc] file: percona_slow_query_log.query_plan_5 pattern: ^#.*Full_scan: Yes.*$ | ||
519 | 110 | [log_grep.inc] lines: 1 | ||
520 | 111 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
521 | 112 | Variable_name Value | ||
522 | 113 | Select_scan 44 | ||
523 | 114 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; | ||
524 | 115 | [log_start.inc] percona_slow_query_log.query_plan_5a | ||
525 | 116 | SELECT COUNT(*) FROM t1; | ||
526 | 117 | COUNT(*) | ||
527 | 118 | 2 | ||
528 | 119 | [log_stop.inc] percona_slow_query_log.query_plan_5a | ||
529 | 120 | [log_grep.inc] file: percona_slow_query_log.query_plan_5a pattern: ^#.*Full_scan: Yes.*$ | ||
530 | 121 | [log_grep.inc] lines: 0 | ||
531 | 122 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
532 | 123 | Variable_name Value | ||
533 | 124 | Select_scan 48 | ||
534 | 125 | SET SESSION log_slow_filter=default; | ||
535 | 126 | CREATE TABLE t3(a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; | ||
536 | 127 | INSERT INTO t3 VALUES (1), (2), (3); | ||
537 | 128 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
538 | 129 | Variable_name Value | ||
539 | 130 | Select_full_join 0 | ||
540 | 131 | [log_start.inc] percona_slow_query_log.query_plan_6 | ||
541 | 132 | SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a; | ||
542 | 133 | COUNT(*) | ||
543 | 134 | 2 | ||
544 | 135 | [log_stop.inc] percona_slow_query_log.query_plan_6 | ||
545 | 136 | [log_grep.inc] file: percona_slow_query_log.query_plan_6 pattern: ^#.*Full_join: No.*$ | ||
546 | 137 | [log_grep.inc] lines: 2 | ||
547 | 138 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
548 | 139 | Variable_name Value | ||
549 | 140 | Select_full_join 0 | ||
550 | 141 | [log_start.inc] percona_slow_query_log.query_plan_7 | ||
551 | 142 | SELECT COUNT(*) FROM t1, t2 WHERE t1.b = t2.a; | ||
552 | 143 | COUNT(*) | ||
553 | 144 | 8192 | ||
554 | 145 | [log_stop.inc] percona_slow_query_log.query_plan_7 | ||
555 | 146 | [log_grep.inc] file: percona_slow_query_log.query_plan_7 pattern: ^#.*Full_join: Yes.*$ | ||
556 | 147 | [log_grep.inc] lines: 1 | ||
557 | 148 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
558 | 149 | Variable_name Value | ||
559 | 150 | Select_full_join 1 | ||
560 | 151 | SET SESSION log_slow_filter='tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; | ||
561 | 152 | [log_start.inc] percona_slow_query_log.query_plan_7a | ||
562 | 153 | SELECT COUNT(*) FROM t1, t2 WHERE t1.b = t2.a; | ||
563 | 154 | COUNT(*) | ||
564 | 155 | 8192 | ||
565 | 156 | [log_stop.inc] percona_slow_query_log.query_plan_7a | ||
566 | 157 | [log_grep.inc] file: percona_slow_query_log.query_plan_7a pattern: ^#.*Full_join: Yes.*$ | ||
567 | 158 | [log_grep.inc] lines: 0 | ||
568 | 159 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
569 | 160 | Variable_name Value | ||
570 | 161 | Select_full_join 2 | ||
571 | 162 | SET SESSION log_slow_filter=default; | ||
572 | 163 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
573 | 164 | Variable_name Value | ||
574 | 165 | Created_tmp_tables 49 | ||
575 | 166 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
576 | 167 | Variable_name Value | ||
577 | 168 | Created_tmp_disk_tables 0 | ||
578 | 169 | EXPLAIN SELECT COUNT(*) FROM t1; | ||
579 | 170 | id select_type table type possible_keys key key_len ref rows Extra | ||
580 | 171 | 1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index | ||
581 | 172 | [log_start.inc] percona_slow_query_log.query_plan_8 | ||
582 | 173 | SELECT COUNT(*) FROM t1; | ||
583 | 174 | COUNT(*) | ||
584 | 175 | 2 | ||
585 | 176 | [log_stop.inc] percona_slow_query_log.query_plan_8 | ||
586 | 177 | [log_grep.inc] file: percona_slow_query_log.query_plan_8 pattern: ^#.*Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0$ | ||
587 | 178 | [log_grep.inc] lines: 2 | ||
588 | 179 | [log_grep.inc] file: percona_slow_query_log.query_plan_8 pattern: ^#.*Tmp_table: No Tmp_table_on_disk: No$ | ||
589 | 180 | [log_grep.inc] lines: 2 | ||
590 | 181 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
591 | 182 | Variable_name Value | ||
592 | 183 | Created_tmp_tables 52 | ||
593 | 184 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
594 | 185 | Variable_name Value | ||
595 | 186 | Created_tmp_disk_tables 0 | ||
596 | 187 | EXPLAIN SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a GROUP BY t3.a; | ||
597 | 188 | id select_type table type possible_keys key key_len ref rows Extra | ||
598 | 189 | 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index; Using temporary; Using filesort | ||
599 | 190 | 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index | ||
600 | 191 | [log_start.inc] percona_slow_query_log.query_plan_9 | ||
601 | 192 | SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a GROUP BY t3.a; | ||
602 | 193 | COUNT(*) | ||
603 | 194 | 1 | ||
604 | 195 | 1 | ||
605 | 196 | [log_stop.inc] percona_slow_query_log.query_plan_9 | ||
606 | 197 | [log_grep.inc] file: percona_slow_query_log.query_plan_9 pattern: ^#.*Tmp_tables: 1 Tmp_disk_tables: 0 Tmp_table_sizes: [1-9][0-9]*$ | ||
607 | 198 | [log_grep.inc] lines: 1 | ||
608 | 199 | [log_grep.inc] file: percona_slow_query_log.query_plan_9 pattern: ^#.*Tmp_table: Yes Tmp_table_on_disk: No$ | ||
609 | 200 | [log_grep.inc] lines: 1 | ||
610 | 201 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
611 | 202 | Variable_name Value | ||
612 | 203 | Created_tmp_tables 56 | ||
613 | 204 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
614 | 205 | Variable_name Value | ||
615 | 206 | Created_tmp_disk_tables 0 | ||
616 | 207 | SET SESSION log_slow_filter='full_join,tmp_table_on_disk,filesort_on_disk'; | ||
617 | 208 | [log_start.inc] percona_slow_query_log.query_plan_9a | ||
618 | 209 | SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a GROUP BY t3.a; | ||
619 | 210 | COUNT(*) | ||
620 | 211 | 1 | ||
621 | 212 | 1 | ||
622 | 213 | [log_stop.inc] percona_slow_query_log.query_plan_9a | ||
623 | 214 | [log_grep.inc] file: percona_slow_query_log.query_plan_9a pattern: ^#.*Tmp_tables: 1 Tmp_disk_tables: 0 Tmp_table_sizes: [1-9][0-9]*$ | ||
624 | 215 | [log_grep.inc] lines: 0 | ||
625 | 216 | [log_grep.inc] file: percona_slow_query_log.query_plan_9a pattern: ^#.*Tmp_table: Yes Tmp_table_on_disk: No$ | ||
626 | 217 | [log_grep.inc] lines: 0 | ||
627 | 218 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
628 | 219 | Variable_name Value | ||
629 | 220 | Created_tmp_tables 60 | ||
630 | 221 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
631 | 222 | Variable_name Value | ||
632 | 223 | Created_tmp_disk_tables 0 | ||
633 | 224 | SET SESSION log_slow_filter=default; | ||
634 | 225 | CREATE TABLE t4(a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; | ||
635 | 226 | INSERT INTO t4 VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"); | ||
636 | 227 | EXPLAIN SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.a; | ||
637 | 228 | id select_type table type possible_keys key key_len ref rows Extra | ||
638 | 229 | 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index; Using temporary; Using filesort | ||
639 | 230 | 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index | ||
640 | 231 | [log_start.inc] percona_slow_query_log.query_plan_10 | ||
641 | 232 | SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.b; | ||
642 | 233 | COUNT(*) | ||
643 | 234 | 1 | ||
644 | 235 | 1 | ||
645 | 236 | [log_stop.inc] percona_slow_query_log.query_plan_10 | ||
646 | 237 | [log_grep.inc] file: percona_slow_query_log.query_plan_10 pattern: ^#.*Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: [1-9][0-9]*$ | ||
647 | 238 | [log_grep.inc] lines: 1 | ||
648 | 239 | [log_grep.inc] file: percona_slow_query_log.query_plan_10 pattern: ^#.*Tmp_table: Yes Tmp_table_on_disk: Yes$ | ||
649 | 240 | [log_grep.inc] lines: 1 | ||
650 | 241 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
651 | 242 | Variable_name Value | ||
652 | 243 | Created_tmp_tables 64 | ||
653 | 244 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
654 | 245 | Variable_name Value | ||
655 | 246 | Created_tmp_disk_tables 1 | ||
656 | 247 | SET SESSION log_slow_filter='full_join,filesort_on_disk'; | ||
657 | 248 | [log_start.inc] percona_slow_query_log.query_plan_10a | ||
658 | 249 | SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.b; | ||
659 | 250 | COUNT(*) | ||
660 | 251 | 1 | ||
661 | 252 | 1 | ||
662 | 253 | [log_stop.inc] percona_slow_query_log.query_plan_10a | ||
663 | 254 | [log_grep.inc] file: percona_slow_query_log.query_plan_10a pattern: ^#.*Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: [1-9][0-9]*$ | ||
664 | 255 | [log_grep.inc] lines: 0 | ||
665 | 256 | [log_grep.inc] file: percona_slow_query_log.query_plan_10a pattern: ^#.*Tmp_table: Yes Tmp_table_on_disk: Yes$ | ||
666 | 257 | [log_grep.inc] lines: 0 | ||
667 | 258 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
668 | 259 | Variable_name Value | ||
669 | 260 | Created_tmp_tables 68 | ||
670 | 261 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
671 | 262 | Variable_name Value | ||
672 | 263 | Created_tmp_disk_tables 2 | ||
673 | 264 | SET SESSION log_slow_filter=default; | ||
674 | 265 | SET SESSION long_query_time=default; | ||
675 | 266 | SET SESSION min_examined_row_limit=default; | ||
676 | 267 | SET SESSION log_slow_verbosity=default; | ||
677 | 268 | DROP TABLE t1, t2, t3, t4; | ||
678 | 0 | 269 | ||
679 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_query_plan_qc.result' | |||
680 | --- Percona-Server/mysql-test/r/percona_log_slow_query_plan_qc.result 1970-01-01 00:00:00 +0000 | |||
681 | +++ Percona-Server/mysql-test/r/percona_log_slow_query_plan_qc.result 2013-01-21 06:27:51 +0000 | |||
682 | @@ -0,0 +1,46 @@ | |||
683 | 1 | FLUSH STATUS; | ||
684 | 2 | SET SESSION min_examined_row_limit=0; | ||
685 | 3 | DROP TABLE IF EXISTS t1; | ||
686 | 4 | CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
687 | 5 | INSERT INTO t1 VALUE(5); | ||
688 | 6 | SET SESSION query_cache_type=1; | ||
689 | 7 | SET GLOBAL query_cache_size=1355776; | ||
690 | 8 | SET SESSION long_query_time=0; | ||
691 | 9 | SET SESSION log_slow_verbosity='microtime,query_plan'; | ||
692 | 10 | [log_start.inc] percona_slow_query_log.query_plan_qc_1 | ||
693 | 11 | SELECT * FROM t1; | ||
694 | 12 | a | ||
695 | 13 | 5 | ||
696 | 14 | [log_stop.inc] percona_slow_query_log.query_plan_qc_1 | ||
697 | 15 | [log_grep.inc] file: percona_slow_query_log.query_plan_qc_1 pattern: ^# QC_Hit: No.*$ | ||
698 | 16 | [log_grep.inc] lines: 2 | ||
699 | 17 | SHOW STATUS LIKE 'Qcache_hits'; | ||
700 | 18 | Variable_name Value | ||
701 | 19 | Qcache_hits 0 | ||
702 | 20 | [log_start.inc] percona_slow_query_log.query_plan_qc_2 | ||
703 | 21 | SELECT * FROM t1; | ||
704 | 22 | a | ||
705 | 23 | 5 | ||
706 | 24 | [log_stop.inc] percona_slow_query_log.query_plan_qc_2 | ||
707 | 25 | [log_grep.inc] file: percona_slow_query_log.query_plan_qc_2 pattern: ^# QC_Hit: Yes.*$ | ||
708 | 26 | [log_grep.inc] lines: 1 | ||
709 | 27 | SHOW STATUS LIKE 'Qcache_hits'; | ||
710 | 28 | Variable_name Value | ||
711 | 29 | Qcache_hits 1 | ||
712 | 30 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; | ||
713 | 31 | [log_start.inc] percona_slow_query_log.query_plan_qc_3 | ||
714 | 32 | SELECT * FROM t1 WHERE a > 5; | ||
715 | 33 | a | ||
716 | 34 | [log_stop.inc] percona_slow_query_log.query_plan_qc_3 | ||
717 | 35 | [log_grep.inc] file: percona_slow_query_log.query_plan_qc_3 pattern: ^# QC_Hit: No.*$ | ||
718 | 36 | [log_grep.inc] lines: 0 | ||
719 | 37 | SHOW STATUS LIKE 'Qcache_hits'; | ||
720 | 38 | Variable_name Value | ||
721 | 39 | Qcache_hits 1 | ||
722 | 40 | SET SESSION log_slow_filter=default; | ||
723 | 41 | SET SESSION long_query_time=default; | ||
724 | 42 | SET SESSION log_slow_verbosity=default; | ||
725 | 43 | SET SESSION query_cache_type=default; | ||
726 | 44 | SET GLOBAL query_cache_size=default; | ||
727 | 45 | SET SESSION min_examined_row_limit=default; | ||
728 | 46 | DROP TABLE t1; | ||
729 | 0 | 47 | ||
730 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result' | |||
731 | --- Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result 1970-01-01 00:00:00 +0000 | |||
732 | +++ Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result 2013-01-21 06:27:51 +0000 | |||
733 | @@ -0,0 +1,28 @@ | |||
734 | 1 | include/master-slave.inc | ||
735 | 2 | [connection master] | ||
736 | 3 | SET SESSION min_examined_row_limit=0; | ||
737 | 4 | DROP TABLE IF EXISTS t; | ||
738 | 5 | CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB; | ||
739 | 6 | INSERT INTO t VALUES | ||
740 | 7 | (1,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
741 | 8 | (2,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
742 | 9 | (3,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
743 | 10 | (4,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
744 | 11 | (5,"aaaaabbbbbcccccdddddeeeeefffff"); | ||
745 | 12 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
746 | 13 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
747 | 14 | SET GLOBAL long_query_time=0; | ||
748 | 15 | SET GLOBAL log_slow_slave_statements=TRUE; | ||
749 | 16 | SET GLOBAL log_slow_verbosity='innodb'; | ||
750 | 17 | include/restart_slave.inc | ||
751 | 18 | [log_start.inc] percona.slow_extended.log_slow_slave_statements-innodb | ||
752 | 19 | INSERT INTO t SELECT t.id,t.data from t; | ||
753 | 20 | [log_stop.inc] percona.slow_extended.log_slow_slave_statements-innodb | ||
754 | 21 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements-innodb pattern: InnoDB_IO_r_ops | ||
755 | 22 | [log_grep.inc] lines: 1 | ||
756 | 23 | DROP TABLE t; | ||
757 | 24 | SET GLOBAL long_query_time=default; | ||
758 | 25 | SET GLOBAL log_slow_slave_statements=default; | ||
759 | 26 | SET GLOBAL log_slow_verbosity=default; | ||
760 | 27 | SET SESSION min_examined_row_limit=default; | ||
761 | 28 | include/rpl_end.inc | ||
762 | 0 | 29 | ||
763 | === removed file 'Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result' | |||
764 | --- Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result 2012-04-18 23:25:38 +0000 | |||
765 | +++ Percona-Server/mysql-test/r/percona_log_slow_slave_statements-innodb.result 1970-01-01 00:00:00 +0000 | |||
766 | @@ -1,19 +0,0 @@ | |||
767 | 1 | include/master-slave.inc | ||
768 | 2 | [connection master] | ||
769 | 3 | DROP TABLE IF EXISTS t; | ||
770 | 4 | CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB; | ||
771 | 5 | INSERT INTO t VALUES | ||
772 | 6 | (1,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
773 | 7 | (2,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
774 | 8 | (3,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
775 | 9 | (4,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
776 | 10 | (5,"aaaaabbbbbcccccdddddeeeeefffff"); | ||
777 | 11 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
778 | 12 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
779 | 13 | [log_start.inc] percona.slow_extended.log_slow_slave_statements-innodb | ||
780 | 14 | INSERT INTO t SELECT t.id,t.data from t; | ||
781 | 15 | [log_stop.inc] percona.slow_extended.log_slow_slave_statements-innodb | ||
782 | 16 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements-innodb pattern: InnoDB_IO_r_ops | ||
783 | 17 | [log_grep.inc] lines: 1 | ||
784 | 18 | DROP TABLE t; | ||
785 | 19 | include/rpl_end.inc | ||
786 | 20 | 0 | ||
787 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result' | |||
788 | --- Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result 1970-01-01 00:00:00 +0000 | |||
789 | +++ Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result 2013-01-21 06:27:51 +0000 | |||
790 | @@ -0,0 +1,30 @@ | |||
791 | 1 | include/master-slave.inc | ||
792 | 2 | [connection master] | ||
793 | 3 | DROP TABLE IF EXISTS t; | ||
794 | 4 | CREATE TABLE t(id INT) ENGINE=InnoDB; | ||
795 | 5 | SET GLOBAL min_examined_row_limit=0; | ||
796 | 6 | SET GLOBAL long_query_time=0; | ||
797 | 7 | SET GLOBAL log_slow_slave_statements=OFF; | ||
798 | 8 | include/restart_slave.inc | ||
799 | 9 | [log_start.inc] percona.slow_extended.log_slow_slave_statements | ||
800 | 10 | INSERT INTO t VALUES (1); | ||
801 | 11 | SET GLOBAL log_slow_slave_statements=ON; | ||
802 | 12 | BEGIN; | ||
803 | 13 | INSERT INTO t VALUES (2); | ||
804 | 14 | COMMIT; | ||
805 | 15 | SET GLOBAL log_slow_slave_statements=OFF; | ||
806 | 16 | INSERT INTO t VALUES (3); | ||
807 | 17 | [log_stop.inc] percona.slow_extended.log_slow_slave_statements | ||
808 | 18 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(1\) | ||
809 | 19 | [log_grep.inc] lines: 0 | ||
810 | 20 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(2\) | ||
811 | 21 | [log_grep.inc] lines: 1 | ||
812 | 22 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(3\) | ||
813 | 23 | [log_grep.inc] lines: 0 | ||
814 | 24 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: ^# User@Host: \[SQL_SLAVE\] @ \[\] | ||
815 | 25 | [log_grep.inc] lines: 2 | ||
816 | 26 | DROP TABLE t; | ||
817 | 27 | SET GLOBAL log_slow_slave_statements=default; | ||
818 | 28 | SET GLOBAL long_query_time=default; | ||
819 | 29 | SET GLOBAL min_examined_row_limit=default; | ||
820 | 30 | include/rpl_end.inc | ||
821 | 0 | 31 | ||
822 | === removed file 'Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result' | |||
823 | --- Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result 2012-04-18 23:25:38 +0000 | |||
824 | +++ Percona-Server/mysql-test/r/percona_log_slow_slave_statements.result 1970-01-01 00:00:00 +0000 | |||
825 | @@ -1,45 +0,0 @@ | |||
826 | 1 | include/master-slave.inc | ||
827 | 2 | [connection master] | ||
828 | 3 | DROP TABLE IF EXISTS t; | ||
829 | 4 | CREATE TABLE t(id INT); | ||
830 | 5 | [log_start.inc] percona.slow_extended.log_slow_slave_statements | ||
831 | 6 | LINE 1 | ||
832 | 7 | LOG_SLOW_SLAVE_STATAMENTS is OFF | ||
833 | 8 | LOG_SLOW_SLAVE_STATEMENTS=ON | ||
834 | 9 | LOG_SLOW_SLAVE_STATAMENTS is ON | ||
835 | 10 | LINE 2 | ||
836 | 11 | include/restart_slave.inc | ||
837 | 12 | LOG_SLOW_SLAVE_STATAMENTS is ON | ||
838 | 13 | LINE 3 | ||
839 | 14 | LOG_SLOW_SLAVE_STATAMENTS is ON | ||
840 | 15 | LOG_SLOW_SLAVE_STATEMENTS=OFF | ||
841 | 16 | LOG_SLOW_SLAVE_STATAMENTS is OFF | ||
842 | 17 | LINE 4 | ||
843 | 18 | include/restart_slave.inc | ||
844 | 19 | LOG_SLOW_SLAVE_STATAMENTS is OFF | ||
845 | 20 | LINE 5 | ||
846 | 21 | LOG_SLOW_SLAVE_STATAMENTS is OFF | ||
847 | 22 | LOG_SLOW_SLAVE_STATEMENTS=ON | ||
848 | 23 | LOG_SLOW_SLAVE_STATAMENTS is ON | ||
849 | 24 | LINE 6 | ||
850 | 25 | include/restart_slave.inc | ||
851 | 26 | LOG_SLOW_SLAVE_STATAMENTS is ON | ||
852 | 27 | LINE 7 | ||
853 | 28 | [log_stop.inc] percona.slow_extended.log_slow_slave_statements | ||
854 | 29 | SET GLOBAL log_slow_slave_statements=default; | ||
855 | 30 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(1\) | ||
856 | 31 | [log_grep.inc] lines: 0 | ||
857 | 32 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(2\) | ||
858 | 33 | [log_grep.inc] lines: 0 | ||
859 | 34 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(3\) | ||
860 | 35 | [log_grep.inc] lines: 1 | ||
861 | 36 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(4\) | ||
862 | 37 | [log_grep.inc] lines: 0 | ||
863 | 38 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(5\) | ||
864 | 39 | [log_grep.inc] lines: 0 | ||
865 | 40 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(6\) | ||
866 | 41 | [log_grep.inc] lines: 0 | ||
867 | 42 | [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: INSERT INTO t VALUES \(7\) | ||
868 | 43 | [log_grep.inc] lines: 1 | ||
869 | 44 | DROP TABLE t; | ||
870 | 45 | include/rpl_end.inc | ||
871 | 46 | 0 | ||
872 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result' | |||
873 | --- Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result 1970-01-01 00:00:00 +0000 | |||
874 | +++ Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result 2013-01-21 06:27:51 +0000 | |||
875 | @@ -0,0 +1,29 @@ | |||
876 | 1 | DROP PROCEDURE IF EXISTS test_f; | ||
877 | 2 | SET SESSION min_examined_row_limit=0; | ||
878 | 3 | SET SESSION long_query_time=0; | ||
879 | 4 | SET SESSION query_cache_type=0; | ||
880 | 5 | CREATE PROCEDURE test_f() | ||
881 | 6 | BEGIN | ||
882 | 7 | SELECT 1; | ||
883 | 8 | END^ | ||
884 | 9 | SET GLOBAL log_slow_sp_statements=ON; | ||
885 | 10 | [log_start.inc] percona.slow_extended.sp1 | ||
886 | 11 | CALL test_f(); | ||
887 | 12 | 1 | ||
888 | 13 | 1 | ||
889 | 14 | [log_stop.inc] percona.slow_extended.sp1 | ||
890 | 15 | [log_grep.inc] file: percona.slow_extended.sp1 pattern: SELECT 1; | ||
891 | 16 | [log_grep.inc] lines: 1 | ||
892 | 17 | SET GLOBAL log_slow_sp_statements=OFF; | ||
893 | 18 | [log_start.inc] percona.slow_extended.sp2 | ||
894 | 19 | CALL test_f(); | ||
895 | 20 | 1 | ||
896 | 21 | 1 | ||
897 | 22 | [log_stop.inc] percona.slow_extended.sp2 | ||
898 | 23 | [log_grep.inc] file: percona.slow_extended.sp2 pattern: SELECT 1; | ||
899 | 24 | [log_grep.inc] lines: 0 | ||
900 | 25 | DROP PROCEDURE test_f; | ||
901 | 26 | SET GLOBAL log_slow_sp_statements=default; | ||
902 | 27 | SET SESSION long_query_time=default; | ||
903 | 28 | SET SESSION min_examined_row_limit=default; | ||
904 | 29 | SET SESSION query_cache_type=default; | ||
905 | 0 | 30 | ||
906 | === removed file 'Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result' | |||
907 | --- Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result 2012-04-18 23:25:38 +0000 | |||
908 | +++ Percona-Server/mysql-test/r/percona_log_slow_sp_statements.result 1970-01-01 00:00:00 +0000 | |||
909 | @@ -1,25 +0,0 @@ | |||
910 | 1 | SET long_query_time=1; | ||
911 | 2 | SET GLOBAL log_slow_sp_statements=ON; | ||
912 | 3 | SET SESSION query_exec_time=0.1; | ||
913 | 4 | [log_start.inc] percona.slow_extended.log_slow_sp_statements | ||
914 | 5 | CREATE PROCEDURE test_f() | ||
915 | 6 | BEGIN | ||
916 | 7 | SET SESSION query_exec_time=1.1; SELECT 1; | ||
917 | 8 | SET SESSION query_exec_time=2.1; SELECT 1; | ||
918 | 9 | SET SESSION query_exec_time=3.1; SELECT 1; | ||
919 | 10 | SET SESSION query_exec_time=0.1; | ||
920 | 11 | END^ | ||
921 | 12 | CALL test_f(); | ||
922 | 13 | 1 | ||
923 | 14 | 1 | ||
924 | 15 | 1 | ||
925 | 16 | 1 | ||
926 | 17 | 1 | ||
927 | 18 | 1 | ||
928 | 19 | [log_stop.inc] percona.slow_extended.log_slow_sp_statements | ||
929 | 20 | SET SESSION query_exec_time=default; | ||
930 | 21 | SET GLOBAL log_slow_sp_statements=default; | ||
931 | 22 | SET long_query_time=default; | ||
932 | 23 | [log_grep.inc] file: percona.slow_extended.log_slow_sp_statements pattern: Query_time | ||
933 | 24 | [log_grep.inc] lines: 3 | ||
934 | 25 | DROP PROCEDURE test_f; | ||
935 | 26 | 0 | ||
936 | === added file 'Percona-Server/mysql-test/r/percona_log_slow_verbosity.result' | |||
937 | --- Percona-Server/mysql-test/r/percona_log_slow_verbosity.result 1970-01-01 00:00:00 +0000 | |||
938 | +++ Percona-Server/mysql-test/r/percona_log_slow_verbosity.result 2013-01-21 06:27:51 +0000 | |||
939 | @@ -0,0 +1,118 @@ | |||
940 | 1 | DROP TABLE IF EXISTS t1; | ||
941 | 2 | CREATE TABLE t1(a INT) ENGINE=InnoDB; | ||
942 | 3 | SET SESSION min_examined_row_limit=0; | ||
943 | 4 | SET SESSION long_query_time=0; | ||
944 | 5 | SET SESSION log_slow_verbosity='microtime,innodb,query_plan'; | ||
945 | 6 | [log_start.inc] percona.slow_extended.log_slow_verbosity_0 | ||
946 | 7 | INSERT INTO t1 VALUE(0); | ||
947 | 8 | [log_stop.inc] percona.slow_extended.log_slow_verbosity_0 | ||
948 | 9 | log_slow_verbosity='microtime,innodb,query_plan': | ||
949 | 10 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Thread_id: \d+ Schema: .+ Last_errno: \d+ Killed: \d+$ | ||
950 | 11 | [log_grep.inc] lines: 2 | ||
951 | 12 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^#.*Rows_affected: \d+ Rows_read: \d+$ | ||
952 | 13 | [log_grep.inc] lines: 2 | ||
953 | 14 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Bytes_sent: \d+.*$ | ||
954 | 15 | [log_grep.inc] lines: 2 | ||
955 | 16 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_trx_id: \w+$ | ||
956 | 17 | [log_grep.inc] lines: 1 | ||
957 | 18 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ | ||
958 | 19 | [log_grep.inc] lines: 2 | ||
959 | 20 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# QC_Hit: (Yes|No) Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$ | ||
960 | 21 | [log_grep.inc] lines: 2 | ||
961 | 22 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+$ | ||
962 | 23 | [log_grep.inc] lines: 2 | ||
963 | 24 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_IO_r_ops: \d+ InnoDB_IO_r_bytes: \d+ InnoDB_IO_r_wait: \d*\.\d*$ | ||
964 | 25 | [log_grep.inc] lines: 1 | ||
965 | 26 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_rec_lock_wait: \d*\.\d* InnoDB_queue_wait: \d*\.\d*$ | ||
966 | 27 | [log_grep.inc] lines: 1 | ||
967 | 28 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_pages_distinct: \d+$ | ||
968 | 29 | [log_grep.inc] lines: 1 | ||
969 | 30 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# No InnoDB statistics available for this query$ | ||
970 | 31 | [log_grep.inc] lines: 1 | ||
971 | 32 | SET SESSION log_slow_verbosity='microtime,innodb,query_plan'; | ||
972 | 33 | [log_start.inc] percona.slow_extended.log_slow_verbosity_1 | ||
973 | 34 | SELECT 1; | ||
974 | 35 | 1 | ||
975 | 36 | 1 | ||
976 | 37 | [log_stop.inc] percona.slow_extended.log_slow_verbosity_1 | ||
977 | 38 | log_slow_verbosity='microtime,innodb,query_plan': | ||
978 | 39 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Thread_id: \d+ Schema: .+ Last_errno: \d+ Killed: \d+$ | ||
979 | 40 | [log_grep.inc] lines: 2 | ||
980 | 41 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^#.*Rows_affected: \d+ Rows_read: \d+$ | ||
981 | 42 | [log_grep.inc] lines: 2 | ||
982 | 43 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Bytes_sent: \d+.*$ | ||
983 | 44 | [log_grep.inc] lines: 2 | ||
984 | 45 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# InnoDB_trx_id: \w+$ | ||
985 | 46 | [log_grep.inc] lines: 0 | ||
986 | 47 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ | ||
987 | 48 | [log_grep.inc] lines: 2 | ||
988 | 49 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# QC_Hit: (Yes|No) Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$ | ||
989 | 50 | [log_grep.inc] lines: 2 | ||
990 | 51 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+$ | ||
991 | 52 | [log_grep.inc] lines: 2 | ||
992 | 53 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# InnoDB_IO_r_ops: \d+ InnoDB_IO_r_bytes: \d+ InnoDB_IO_r_wait: \d*\.\d*$ | ||
993 | 54 | [log_grep.inc] lines: 0 | ||
994 | 55 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# InnoDB_rec_lock_wait: \d*\.\d* InnoDB_queue_wait: \d*\.\d*$ | ||
995 | 56 | [log_grep.inc] lines: 0 | ||
996 | 57 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# InnoDB_pages_distinct: \d+$ | ||
997 | 58 | [log_grep.inc] lines: 0 | ||
998 | 59 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# No InnoDB statistics available for this query$ | ||
999 | 60 | [log_grep.inc] lines: 2 | ||
1000 | 61 | SET log_slow_verbosity='microtime'; | ||
1001 | 62 | [log_start.inc] percona.slow_extended.log_slow_verbosity_2 | ||
1002 | 63 | INSERT INTO t1 VALUE(1); | ||
1003 | 64 | [log_stop.inc] percona.slow_extended.log_slow_verbosity_2 | ||
1004 | 65 | log_slow_verbosity='microtime': | ||
1005 | 66 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Thread_id: \d+ Schema: .+ Last_errno: \d+ Killed: \d+$ | ||
1006 | 67 | [log_grep.inc] lines: 2 | ||
1007 | 68 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^#.*Rows_affected: \d+ Rows_read: \d+$ | ||
1008 | 69 | [log_grep.inc] lines: 2 | ||
1009 | 70 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Bytes_sent: \d+.*$ | ||
1010 | 71 | [log_grep.inc] lines: 2 | ||
1011 | 72 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# InnoDB_trx_id: \w+$ | ||
1012 | 73 | [log_grep.inc] lines: 0 | ||
1013 | 74 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ | ||
1014 | 75 | [log_grep.inc] lines: 0 | ||
1015 | 76 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# QC_Hit: (Yes|No) Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$ | ||
1016 | 77 | [log_grep.inc] lines: 0 | ||
1017 | 78 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+$ | ||
1018 | 79 | [log_grep.inc] lines: 0 | ||
1019 | 80 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# InnoDB_IO_r_ops: \d+ InnoDB_IO_r_bytes: \d+ InnoDB_IO_r_wait: \d*\.\d*$ | ||
1020 | 81 | [log_grep.inc] lines: 0 | ||
1021 | 82 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# InnoDB_rec_lock_wait: \d*\.\d* InnoDB_queue_wait: \d*\.\d*$ | ||
1022 | 83 | [log_grep.inc] lines: 0 | ||
1023 | 84 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# InnoDB_pages_distinct: \d+$ | ||
1024 | 85 | [log_grep.inc] lines: 0 | ||
1025 | 86 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# No InnoDB statistics available for this query$ | ||
1026 | 87 | [log_grep.inc] lines: 0 | ||
1027 | 88 | SET log_slow_verbosity='microtime,query_plan'; | ||
1028 | 89 | [log_start.inc] percona.slow_extended.log_slow_verbosity_3 | ||
1029 | 90 | INSERT INTO t1 VALUE(2); | ||
1030 | 91 | [log_stop.inc] percona.slow_extended.log_slow_verbosity_3 | ||
1031 | 92 | log_slow_verbosity='query_plan': | ||
1032 | 93 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Thread_id: \d+ Schema: .+ Last_errno: \d+ Killed: \d+$ | ||
1033 | 94 | [log_grep.inc] lines: 2 | ||
1034 | 95 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^#.*Rows_affected: \d+ Rows_read: \d+$ | ||
1035 | 96 | [log_grep.inc] lines: 2 | ||
1036 | 97 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Bytes_sent: \d+.*$ | ||
1037 | 98 | [log_grep.inc] lines: 2 | ||
1038 | 99 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# InnoDB_trx_id: \w+$ | ||
1039 | 100 | [log_grep.inc] lines: 0 | ||
1040 | 101 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ | ||
1041 | 102 | [log_grep.inc] lines: 2 | ||
1042 | 103 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# QC_Hit: (Yes|No) Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$ | ||
1043 | 104 | [log_grep.inc] lines: 2 | ||
1044 | 105 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+$ | ||
1045 | 106 | [log_grep.inc] lines: 2 | ||
1046 | 107 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# InnoDB_IO_r_ops: \d+ InnoDB_IO_r_bytes: \d+ InnoDB_IO_r_wait: \d*\.\d*$ | ||
1047 | 108 | [log_grep.inc] lines: 0 | ||
1048 | 109 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# InnoDB_rec_lock_wait: \d*\.\d* InnoDB_queue_wait: \d*\.\d*$ | ||
1049 | 110 | [log_grep.inc] lines: 0 | ||
1050 | 111 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# InnoDB_pages_distinct: \d+$ | ||
1051 | 112 | [log_grep.inc] lines: 0 | ||
1052 | 113 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# No InnoDB statistics available for this query$ | ||
1053 | 114 | [log_grep.inc] lines: 0 | ||
1054 | 115 | SET SESSION log_slow_verbosity=default; | ||
1055 | 116 | SET SESSION long_query_time=default; | ||
1056 | 117 | SET SESSION min_examined_row_limit=default; | ||
1057 | 118 | DROP TABLE t1; | ||
1058 | 0 | 119 | ||
1059 | === removed file 'Percona-Server/mysql-test/r/percona_log_slow_verbosity.result' | |||
1060 | --- Percona-Server/mysql-test/r/percona_log_slow_verbosity.result 2012-04-18 23:25:38 +0000 | |||
1061 | +++ Percona-Server/mysql-test/r/percona_log_slow_verbosity.result 1970-01-01 00:00:00 +0000 | |||
1062 | @@ -1,16 +0,0 @@ | |||
1063 | 1 | SET SESSION long_query_time=1; | ||
1064 | 2 | [log_start.inc] percona.slow_extended.log_slow_verbosity | ||
1065 | 3 | SET SESSION query_exec_time=2.1; | ||
1066 | 4 | SELECT 1; | ||
1067 | 5 | 1 | ||
1068 | 6 | 1 | ||
1069 | 7 | SET SESSION log_slow_verbosity=innodb; | ||
1070 | 8 | SELECT 1; | ||
1071 | 9 | 1 | ||
1072 | 10 | 1 | ||
1073 | 11 | SET SESSION query_exec_time=default; | ||
1074 | 12 | [log_stop.inc] percona.slow_extended.log_slow_verbosity | ||
1075 | 13 | SET log_slow_verbosity=default; | ||
1076 | 14 | SET long_query_time=default; | ||
1077 | 15 | [log_grep.inc] file: percona.slow_extended.log_slow_verbosity pattern: No InnoDB statistics available for this query | ||
1078 | 16 | [log_grep.inc] lines: 1 | ||
1079 | 17 | 0 | ||
1080 | === added file 'Percona-Server/mysql-test/r/percona_long_query_time.result' | |||
1081 | --- Percona-Server/mysql-test/r/percona_long_query_time.result 1970-01-01 00:00:00 +0000 | |||
1082 | +++ Percona-Server/mysql-test/r/percona_long_query_time.result 2013-01-21 06:27:51 +0000 | |||
1083 | @@ -0,0 +1,35 @@ | |||
1084 | 1 | SET SESSION min_examined_row_limit=0; | ||
1085 | 2 | SET long_query_time=2; | ||
1086 | 3 | [log_start.inc] percona.slow_extended.long_query_time | ||
1087 | 4 | SET SESSION query_exec_time=1.1; | ||
1088 | 5 | SELECT 1; | ||
1089 | 6 | 1 | ||
1090 | 7 | 1 | ||
1091 | 8 | SET SESSION query_exec_time=3.1; | ||
1092 | 9 | SELECT 1; | ||
1093 | 10 | 1 | ||
1094 | 11 | 1 | ||
1095 | 12 | SET SESSION query_exec_time=5.1; | ||
1096 | 13 | SELECT 1; | ||
1097 | 14 | 1 | ||
1098 | 15 | 1 | ||
1099 | 16 | SET long_query_time=4; | ||
1100 | 17 | SET SESSION query_exec_time=1.1; | ||
1101 | 18 | SELECT 1; | ||
1102 | 19 | 1 | ||
1103 | 20 | 1 | ||
1104 | 21 | SET SESSION query_exec_time=3.1; | ||
1105 | 22 | SELECT 1; | ||
1106 | 23 | 1 | ||
1107 | 24 | 1 | ||
1108 | 25 | SET SESSION query_exec_time=5.1; | ||
1109 | 26 | SELECT 1; | ||
1110 | 27 | 1 | ||
1111 | 28 | 1 | ||
1112 | 29 | SET SESSION query_exec_time=default; | ||
1113 | 30 | SET long_query_time=2; | ||
1114 | 31 | [log_stop.inc] percona.slow_extended.long_query_time | ||
1115 | 32 | SET long_query_time=default; | ||
1116 | 33 | SET SESSION min_examined_row_limit=default; | ||
1117 | 34 | [log_grep.inc] file: percona.slow_extended.long_query_time pattern: Query_time | ||
1118 | 35 | [log_grep.inc] lines: 3 | ||
1119 | 0 | 36 | ||
1120 | === removed file 'Percona-Server/mysql-test/r/percona_long_query_time.result' | |||
1121 | --- Percona-Server/mysql-test/r/percona_long_query_time.result 2012-04-18 23:25:38 +0000 | |||
1122 | +++ Percona-Server/mysql-test/r/percona_long_query_time.result 1970-01-01 00:00:00 +0000 | |||
1123 | @@ -1,33 +0,0 @@ | |||
1124 | 1 | SET long_query_time=2; | ||
1125 | 2 | [log_start.inc] percona.slow_extended.long_query_time | ||
1126 | 3 | SET SESSION query_exec_time=1.1; | ||
1127 | 4 | SELECT 1; | ||
1128 | 5 | 1 | ||
1129 | 6 | 1 | ||
1130 | 7 | SET SESSION query_exec_time=3.1; | ||
1131 | 8 | SELECT 1; | ||
1132 | 9 | 1 | ||
1133 | 10 | 1 | ||
1134 | 11 | SET SESSION query_exec_time=5.1; | ||
1135 | 12 | SELECT 1; | ||
1136 | 13 | 1 | ||
1137 | 14 | 1 | ||
1138 | 15 | SET long_query_time=4; | ||
1139 | 16 | SET SESSION query_exec_time=1.1; | ||
1140 | 17 | SELECT 1; | ||
1141 | 18 | 1 | ||
1142 | 19 | 1 | ||
1143 | 20 | SET SESSION query_exec_time=3.1; | ||
1144 | 21 | SELECT 1; | ||
1145 | 22 | 1 | ||
1146 | 23 | 1 | ||
1147 | 24 | SET SESSION query_exec_time=5.1; | ||
1148 | 25 | SELECT 1; | ||
1149 | 26 | 1 | ||
1150 | 27 | 1 | ||
1151 | 28 | SET SESSION query_exec_time=default; | ||
1152 | 29 | SET long_query_time=2; | ||
1153 | 30 | [log_stop.inc] percona.slow_extended.long_query_time | ||
1154 | 31 | SET long_query_time=default; | ||
1155 | 32 | [log_grep.inc] file: percona.slow_extended.long_query_time pattern: Query_time | ||
1156 | 33 | [log_grep.inc] lines: 3 | ||
1157 | 34 | 0 | ||
1158 | === modified file 'Percona-Server/mysql-test/r/percona_min_examined_row_limit.result' | |||
1159 | --- Percona-Server/mysql-test/r/percona_min_examined_row_limit.result 2012-04-18 23:25:38 +0000 | |||
1160 | +++ Percona-Server/mysql-test/r/percona_min_examined_row_limit.result 2013-01-21 06:27:51 +0000 | |||
1161 | @@ -11,7 +11,7 @@ | |||
1162 | 11 | 1 | 11 | 1 |
1163 | 12 | 1 | 12 | 1 |
1164 | 13 | SET GLOBAL min_examined_row_limit=5; | 13 | SET GLOBAL min_examined_row_limit=5; |
1166 | 14 | select * from t as t1, t as t2; | 14 | SELECT * FROM t AS t1, t AS t2; |
1167 | 15 | id id | 15 | id id |
1168 | 16 | 1 1 | 16 | 1 1 |
1169 | 17 | 2 1 | 17 | 2 1 |
1170 | 18 | 18 | ||
1171 | === modified file 'Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result' | |||
1172 | --- Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result 2012-10-27 05:16:07 +0000 | |||
1173 | +++ Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result 2013-01-21 06:27:51 +0000 | |||
1174 | @@ -1,172 +1,27 @@ | |||
1175 | 1 | DROP TABLE IF EXISTS t; | 1 | DROP TABLE IF EXISTS t; |
1293 | 2 | CREATE TABLE t(a INT) engine=InnoDB; | 2 | SET GLOBAL log_slow_admin_statements=ON; |
1294 | 3 | INSERT INTO t VALUES(0),(1),(2),(3),(4); | 3 | SET GLOBAL long_query_time=0; |
1295 | 4 | [log_start.inc] percona.slow_extended.error_on_quit | 4 | SET GLOBAL min_examined_row_limit=0; |
1296 | 5 | SET log_slow_verbosity=innodb; | 5 | CREATE TABLE t(a INT) engine=InnoDB; |
1297 | 6 | SET long_query_time= 0; | 6 | [log_start.inc] percona.slow_extended.error_on_quit_1 |
1298 | 7 | CREATE TABLE t(a INT) engine=InnoDB; | 7 | CREATE TABLE t(a INT) engine=InnoDB; |
1299 | 8 | # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | 8 | ERROR 42S01: Table 't' already exists |
1300 | 9 | [log_stop.inc] percona.slow_extended.error_on_quit | 9 | [log_stop.inc] percona.slow_extended.error_on_quit_1 |
1301 | 10 | ################################################################################ | 10 | [log_grep.inc] file: percona.slow_extended.error_on_quit_1 pattern: Last_errno: [1-9]\d*\s |
1302 | 11 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: CREATE | 11 | [log_grep.inc] lines: 1 |
1303 | 12 | [log_grep.inc] lines: 1 | 12 | [log_start.inc] percona.slow_extended.error_on_quit_2 |
1304 | 13 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: INSERT | 13 | # Disconnecting (passing to Slow Query Log "# administrative command: Quit") |
1305 | 14 | [log_grep.inc] lines: 0 | 14 | [log_stop.inc] percona.slow_extended.error_on_quit_2 |
1306 | 15 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: SELECT | 15 | [log_grep.inc] file: percona.slow_extended.error_on_quit_2 pattern: Last_errno: 0\s |
1307 | 16 | [log_grep.inc] lines: 0 | 16 | [log_grep.inc] lines: 2 |
1308 | 17 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Quit | 17 | [log_start.inc] percona.slow_extended.error_on_quit_3 |
1192 | 18 | [log_grep.inc] lines: 1 | ||
1193 | 19 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: [^0]+ | ||
1194 | 20 | [log_grep.inc] lines: 1 | ||
1195 | 21 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: 0 | ||
1196 | 22 | [log_grep.inc] lines: 2 | ||
1197 | 23 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_sent: [^0]+ | ||
1198 | 24 | [log_grep.inc] lines: 0 | ||
1199 | 25 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_sent: 0 | ||
1200 | 26 | [log_grep.inc] lines: 3 | ||
1201 | 27 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_examined: [^0]+ | ||
1202 | 28 | [log_grep.inc] lines: 0 | ||
1203 | 29 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_examined: 0 | ||
1204 | 30 | [log_grep.inc] lines: 3 | ||
1205 | 31 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: [^0]+ | ||
1206 | 32 | [log_grep.inc] lines: 0 | ||
1207 | 33 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0 | ||
1208 | 34 | [log_grep.inc] lines: 3 | ||
1209 | 35 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+ | ||
1210 | 36 | [log_grep.inc] lines: 0 | ||
1211 | 37 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0 | ||
1212 | 38 | [log_grep.inc] lines: 3 | ||
1213 | 39 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+ | ||
1214 | 40 | [log_grep.inc] lines: 2 | ||
1215 | 41 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0 | ||
1216 | 42 | [log_grep.inc] lines: 1 | ||
1217 | 43 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_tables: [^0]+ | ||
1218 | 44 | [log_grep.inc] lines: 0 | ||
1219 | 45 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_tables: 0 | ||
1220 | 46 | [log_grep.inc] lines: 3 | ||
1221 | 47 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_disk_tables: [^0]+ | ||
1222 | 48 | [log_grep.inc] lines: 0 | ||
1223 | 49 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_disk_tables: 0 | ||
1224 | 50 | [log_grep.inc] lines: 3 | ||
1225 | 51 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_table_sizes: [^0]+ | ||
1226 | 52 | [log_grep.inc] lines: 0 | ||
1227 | 53 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_table_sizes: 0 | ||
1228 | 54 | [log_grep.inc] lines: 3 | ||
1229 | 55 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: # No InnoDB statistics available for this query | ||
1230 | 56 | [log_grep.inc] lines: 2 | ||
1231 | 57 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: # InnoDB_trx_id: | ||
1232 | 58 | [log_grep.inc] lines: 1 | ||
1233 | 59 | ################################################################################ | ||
1234 | 60 | [log_start.inc] percona.slow_extended.error_on_quit | ||
1235 | 61 | SET log_slow_verbosity=innodb; | ||
1236 | 62 | SET long_query_time= 0; | ||
1237 | 63 | INSERT INTO t SELECT * FROM t ORDER BY RAND(); | ||
1238 | 64 | # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | ||
1239 | 65 | [log_stop.inc] percona.slow_extended.error_on_quit | ||
1240 | 66 | ################################################################################ | ||
1241 | 67 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: CREATE | ||
1242 | 68 | [log_grep.inc] lines: 0 | ||
1243 | 69 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: INSERT | ||
1244 | 70 | [log_grep.inc] lines: 1 | ||
1245 | 71 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: SELECT | ||
1246 | 72 | [log_grep.inc] lines: 1 | ||
1247 | 73 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Quit | ||
1248 | 74 | [log_grep.inc] lines: 1 | ||
1249 | 75 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: [^0]+ | ||
1250 | 76 | [log_grep.inc] lines: 0 | ||
1251 | 77 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: 0 | ||
1252 | 78 | [log_grep.inc] lines: 3 | ||
1253 | 79 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_sent: [^0]+ | ||
1254 | 80 | [log_grep.inc] lines: 0 | ||
1255 | 81 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_sent: 0 | ||
1256 | 82 | [log_grep.inc] lines: 3 | ||
1257 | 83 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_examined: [^0]+ | ||
1258 | 84 | [log_grep.inc] lines: 1 | ||
1259 | 85 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_examined: 0 | ||
1260 | 86 | [log_grep.inc] lines: 2 | ||
1261 | 87 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: [^0]+ | ||
1262 | 88 | [log_grep.inc] lines: 2 | ||
1263 | 89 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0 | ||
1264 | 90 | [log_grep.inc] lines: 1 | ||
1265 | 91 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+ | ||
1266 | 92 | [log_grep.inc] lines: 1 | ||
1267 | 93 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0 | ||
1268 | 94 | [log_grep.inc] lines: 2 | ||
1269 | 95 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+ | ||
1270 | 96 | [log_grep.inc] lines: 2 | ||
1271 | 97 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0 | ||
1272 | 98 | [log_grep.inc] lines: 1 | ||
1273 | 99 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_tables: [^0]+ | ||
1274 | 100 | [log_grep.inc] lines: 1 | ||
1275 | 101 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_tables: 0 | ||
1276 | 102 | [log_grep.inc] lines: 2 | ||
1277 | 103 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_disk_tables: [^0]+ | ||
1278 | 104 | [log_grep.inc] lines: 0 | ||
1279 | 105 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_disk_tables: 0 | ||
1280 | 106 | [log_grep.inc] lines: 3 | ||
1281 | 107 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_table_sizes: [^0]+ | ||
1282 | 108 | [log_grep.inc] lines: 1 | ||
1283 | 109 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_table_sizes: 0 | ||
1284 | 110 | [log_grep.inc] lines: 2 | ||
1285 | 111 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: # No InnoDB statistics available for this query | ||
1286 | 112 | [log_grep.inc] lines: 2 | ||
1287 | 113 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: # InnoDB_trx_id: | ||
1288 | 114 | [log_grep.inc] lines: 1 | ||
1289 | 115 | ################################################################################ | ||
1290 | 116 | [log_start.inc] percona.slow_extended.error_on_quit | ||
1291 | 117 | SET log_slow_verbosity=innodb; | ||
1292 | 118 | SET long_query_time= 0; | ||
1309 | 119 | SELECT * FROM t; | 18 | SELECT * FROM t; |
1310 | 19 | a | ||
1311 | 120 | # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | 20 | # Disconnecting (passing to Slow Query Log "# administrative command: Quit") |
1363 | 121 | [log_stop.inc] percona.slow_extended.error_on_quit | 21 | [log_stop.inc] percona.slow_extended.error_on_quit_3 |
1364 | 122 | ################################################################################ | 22 | [log_grep.inc] file: percona.slow_extended.error_on_quit_3 pattern: Last_errno: 0\s |
1365 | 123 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: CREATE | 23 | [log_grep.inc] lines: 3 |
1315 | 124 | [log_grep.inc] lines: 0 | ||
1316 | 125 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: INSERT | ||
1317 | 126 | [log_grep.inc] lines: 0 | ||
1318 | 127 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: SELECT | ||
1319 | 128 | [log_grep.inc] lines: 1 | ||
1320 | 129 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Quit | ||
1321 | 130 | [log_grep.inc] lines: 1 | ||
1322 | 131 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: [^0]+ | ||
1323 | 132 | [log_grep.inc] lines: 0 | ||
1324 | 133 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: 0 | ||
1325 | 134 | [log_grep.inc] lines: 3 | ||
1326 | 135 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_sent: [^0]+ | ||
1327 | 136 | [log_grep.inc] lines: 1 | ||
1328 | 137 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_sent: 0 | ||
1329 | 138 | [log_grep.inc] lines: 2 | ||
1330 | 139 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_examined: [^0]+ | ||
1331 | 140 | [log_grep.inc] lines: 1 | ||
1332 | 141 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_examined: 0 | ||
1333 | 142 | [log_grep.inc] lines: 2 | ||
1334 | 143 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: [^0]+ | ||
1335 | 144 | [log_grep.inc] lines: 0 | ||
1336 | 145 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0 | ||
1337 | 146 | [log_grep.inc] lines: 3 | ||
1338 | 147 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+ | ||
1339 | 148 | [log_grep.inc] lines: 1 | ||
1340 | 149 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0 | ||
1341 | 150 | [log_grep.inc] lines: 2 | ||
1342 | 151 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+ | ||
1343 | 152 | [log_grep.inc] lines: 2 | ||
1344 | 153 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0 | ||
1345 | 154 | [log_grep.inc] lines: 1 | ||
1346 | 155 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_tables: [^0]+ | ||
1347 | 156 | [log_grep.inc] lines: 0 | ||
1348 | 157 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_tables: 0 | ||
1349 | 158 | [log_grep.inc] lines: 3 | ||
1350 | 159 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_disk_tables: [^0]+ | ||
1351 | 160 | [log_grep.inc] lines: 0 | ||
1352 | 161 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_disk_tables: 0 | ||
1353 | 162 | [log_grep.inc] lines: 3 | ||
1354 | 163 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_table_sizes: [^0]+ | ||
1355 | 164 | [log_grep.inc] lines: 0 | ||
1356 | 165 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Tmp_table_sizes: 0 | ||
1357 | 166 | [log_grep.inc] lines: 3 | ||
1358 | 167 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: # No InnoDB statistics available for this query | ||
1359 | 168 | [log_grep.inc] lines: 2 | ||
1360 | 169 | [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: # InnoDB_trx_id: | ||
1361 | 170 | [log_grep.inc] lines: 1 | ||
1362 | 171 | ################################################################################ | ||
1366 | 172 | DROP TABLE t; | 24 | DROP TABLE t; |
1367 | 25 | SET GLOBAL log_slow_admin_statements=default; | ||
1368 | 26 | SET GLOBAL long_query_time=default; | ||
1369 | 27 | SET GLOBAL min_examined_row_limit=default; | ||
1370 | 173 | 28 | ||
1371 | === added file 'Percona-Server/mysql-test/r/percona_slow_extended_log_error.result' | |||
1372 | --- Percona-Server/mysql-test/r/percona_slow_extended_log_error.result 1970-01-01 00:00:00 +0000 | |||
1373 | +++ Percona-Server/mysql-test/r/percona_slow_extended_log_error.result 2013-01-21 06:27:51 +0000 | |||
1374 | @@ -0,0 +1,17 @@ | |||
1375 | 1 | DROP TABLE IF EXISTS t1; | ||
1376 | 2 | SET SESSION min_examined_row_limit=0; | ||
1377 | 3 | SET long_query_time=0; | ||
1378 | 4 | [log_start.inc] percona.slow_extended.log_error_1 | ||
1379 | 5 | CREATE TABLE t1(a INT); | ||
1380 | 6 | [log_stop.inc] percona.slow_extended.log_error_1 | ||
1381 | 7 | [log_grep.inc] file: percona.slow_extended.log_error_1 pattern: ^.*Last_errno: 0 .*$ | ||
1382 | 8 | [log_grep.inc] lines: 2 | ||
1383 | 9 | [log_start.inc] percona.slow_extended.log_error_2 | ||
1384 | 10 | CREATE TABLE t1(a INT); | ||
1385 | 11 | ERROR 42S01: Table 't1' already exists | ||
1386 | 12 | [log_stop.inc] percona.slow_extended.log_error_2 | ||
1387 | 13 | [log_grep.inc] file: percona.slow_extended.log_error_2 pattern: ^.*Last_errno: 1050 .*$ | ||
1388 | 14 | [log_grep.inc] lines: 1 | ||
1389 | 15 | DROP TABLE t1; | ||
1390 | 16 | SET long_query_time=default; | ||
1391 | 17 | SET SESSION min_examined_row_limit=default; | ||
1392 | 0 | 18 | ||
1393 | === removed file 'Percona-Server/mysql-test/r/percona_slow_extended_log_error.result' | |||
1394 | --- Percona-Server/mysql-test/r/percona_slow_extended_log_error.result 2012-04-18 23:25:38 +0000 | |||
1395 | +++ Percona-Server/mysql-test/r/percona_slow_extended_log_error.result 1970-01-01 00:00:00 +0000 | |||
1396 | @@ -1,10 +0,0 @@ | |||
1397 | 1 | SET long_query_time=0; | ||
1398 | 2 | DROP TABLE IF EXISTS t1; | ||
1399 | 3 | CREATE TABLE t(a INT); | ||
1400 | 4 | [log_start.inc] percona.slow_extended.log_error | ||
1401 | 5 | CREATE TABLE t(a INT); | ||
1402 | 6 | ERROR 42S01: Table 't' already exists | ||
1403 | 7 | [log_stop.inc] percona.slow_extended.log_error | ||
1404 | 8 | [log_grep.inc] file: percona.slow_extended.log_error pattern: Last_errno: 1050 | ||
1405 | 9 | [log_grep.inc] lines: 1 | ||
1406 | 10 | DROP TABLE t; | ||
1407 | 11 | 0 | ||
1408 | === modified file 'Percona-Server/mysql-test/r/percona_slow_query_log_rate.result' | |||
1409 | --- Percona-Server/mysql-test/r/percona_slow_query_log_rate.result 2012-04-18 23:25:38 +0000 | |||
1410 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_rate.result 2013-01-21 06:27:51 +0000 | |||
1411 | @@ -1,78 +1,54 @@ | |||
1413 | 1 | SET GLOBAL long_query_time=1; | 1 | SET GLOBAL long_query_time=0; |
1414 | 2 | SET GLOBAL log_slow_rate_type='session'; | 2 | SET GLOBAL log_slow_rate_type='session'; |
1415 | 3 | SET GLOBAL log_slow_rate_limit=3; | 3 | SET GLOBAL log_slow_rate_limit=3; |
1449 | 4 | [log_start.inc] percona.slow_extended.log_slow_rate_limit | 4 | [log_start.inc] percona.slow_extended.log_slow_rate_limit_1 |
1450 | 5 | SET SESSION query_exec_time=1.1; | 5 | SELECT 'connection_one'; |
1451 | 6 | SET SESSION query_exec_id=1; | 6 | connection_one |
1452 | 7 | SELECT 'connection_one'; | 7 | connection_one |
1453 | 8 | connection_one | 8 | SELECT 'connection_two'; |
1454 | 9 | connection_one | 9 | connection_two |
1455 | 10 | SET SESSION query_exec_time=1.1; | 10 | connection_two |
1456 | 11 | SET SESSION query_exec_id=2; | 11 | SELECT 'connection_three'; |
1457 | 12 | SELECT 'connection_two'; | 12 | connection_three |
1458 | 13 | connection_two | 13 | connection_three |
1459 | 14 | connection_two | 14 | SELECT 'connection_one'; |
1460 | 15 | SET SESSION query_exec_time=1.1; | 15 | connection_one |
1461 | 16 | SET SESSION query_exec_id=3; | 16 | connection_one |
1462 | 17 | SELECT 'connection_three'; | 17 | SELECT 'connection_two'; |
1463 | 18 | connection_three | 18 | connection_two |
1464 | 19 | connection_three | 19 | connection_two |
1465 | 20 | SET SESSION query_exec_time=1.1; | 20 | SELECT 'connection_three'; |
1466 | 21 | SET SESSION query_exec_id=4; | 21 | connection_three |
1467 | 22 | SELECT 'connection_one'; | 22 | connection_three |
1468 | 23 | connection_one | 23 | [log_stop.inc] percona.slow_extended.log_slow_rate_limit_1 |
1469 | 24 | connection_one | 24 | [log_grep.inc] file: percona.slow_extended.log_slow_rate_limit_1 pattern: |
1437 | 25 | SET SESSION query_exec_time=1.1; | ||
1438 | 26 | SET SESSION query_exec_id=5; | ||
1439 | 27 | SELECT 'connection_two'; | ||
1440 | 28 | connection_two | ||
1441 | 29 | connection_two | ||
1442 | 30 | SET SESSION query_exec_time=1.1; | ||
1443 | 31 | SET SESSION query_exec_id=6; | ||
1444 | 32 | SELECT 'connection_three'; | ||
1445 | 33 | connection_three | ||
1446 | 34 | connection_three | ||
1447 | 35 | [log_stop.inc] percona.slow_extended.log_slow_rate_limit | ||
1448 | 36 | [log_grep.inc] file: percona.slow_extended.log_slow_rate_limit pattern: | ||
1470 | 37 | [log_grep.inc] sum: 2 | 25 | [log_grep.inc] sum: 2 |
1471 | 38 | [log_grep.inc] zero: 2 | 26 | [log_grep.inc] zero: 2 |
1472 | 39 | SET GLOBAL log_slow_rate_type='query'; | 27 | SET GLOBAL log_slow_rate_type='query'; |
1473 | 40 | SET GLOBAL log_slow_rate_limit=2; | 28 | SET GLOBAL log_slow_rate_limit=2; |
1509 | 41 | [log_start.inc] percona.slow_extended.log_slow_rate_limit | 29 | [log_start.inc] percona.slow_extended.log_slow_rate_limit_2 |
1510 | 42 | SET SESSION query_exec_time=1.1; | 30 | SELECT 'connection_one'; |
1511 | 43 | SET SESSION query_exec_id=1; | 31 | connection_one |
1512 | 44 | SELECT 'connection_one'; | 32 | connection_one |
1513 | 45 | connection_one | 33 | SELECT 'connection_two'; |
1514 | 46 | connection_one | 34 | connection_two |
1515 | 47 | SET SESSION query_exec_time=1.1; | 35 | connection_two |
1516 | 48 | SET SESSION query_exec_id=2; | 36 | SELECT 'connection_three'; |
1517 | 49 | SELECT 'connection_two'; | 37 | connection_three |
1518 | 50 | connection_two | 38 | connection_three |
1519 | 51 | connection_two | 39 | SELECT 'connection_one'; |
1520 | 52 | SET SESSION query_exec_time=1.1; | 40 | connection_one |
1521 | 53 | SET SESSION query_exec_id=3; | 41 | connection_one |
1522 | 54 | SELECT 'connection_three'; | 42 | SELECT 'connection_two'; |
1523 | 55 | connection_three | 43 | connection_two |
1524 | 56 | connection_three | 44 | connection_two |
1525 | 57 | SET SESSION query_exec_time=1.1; | 45 | SELECT 'connection_three'; |
1526 | 58 | SET SESSION query_exec_id=4; | 46 | connection_three |
1527 | 59 | SELECT 'connection_one'; | 47 | connection_three |
1528 | 60 | connection_one | 48 | [log_stop.inc] percona.slow_extended.log_slow_rate_limit_2 |
1529 | 61 | connection_one | 49 | [log_grep.inc] file: percona.slow_extended.log_slow_rate_limit_2 pattern: |
1530 | 62 | SET SESSION query_exec_time=1.1; | 50 | [log_grep.inc] sum: 0 |
1531 | 63 | SET SESSION query_exec_id=5; | 51 | [log_grep.inc] zero: 3 |
1497 | 64 | SELECT 'connection_two'; | ||
1498 | 65 | connection_two | ||
1499 | 66 | connection_two | ||
1500 | 67 | SET SESSION query_exec_time=1.1; | ||
1501 | 68 | SET SESSION query_exec_id=6; | ||
1502 | 69 | SELECT 'connection_three'; | ||
1503 | 70 | connection_three | ||
1504 | 71 | connection_three | ||
1505 | 72 | [log_stop.inc] percona.slow_extended.log_slow_rate_limit | ||
1506 | 73 | [log_grep.inc] file: percona.slow_extended.log_slow_rate_limit pattern: | ||
1507 | 74 | [log_grep.inc] sum: 3 | ||
1508 | 75 | [log_grep.inc] zero: 0 | ||
1532 | 76 | SET GLOBAL long_query_time=default; | 52 | SET GLOBAL long_query_time=default; |
1533 | 77 | SET GLOBAL log_slow_rate_type=default; | 53 | SET GLOBAL log_slow_rate_type=default; |
1534 | 78 | SET GLOBAL log_slow_rate_limit=default; | 54 | SET GLOBAL log_slow_rate_limit=default; |
1535 | 79 | 55 | ||
1536 | === added file 'Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result' | |||
1537 | --- Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result 1970-01-01 00:00:00 +0000 | |||
1538 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result 2013-01-21 06:27:51 +0000 | |||
1539 | @@ -0,0 +1,16 @@ | |||
1540 | 1 | SET SESSION min_examined_row_limit=0; | ||
1541 | 2 | SET SESSION long_query_time=0; | ||
1542 | 3 | SET GLOBAL slow_query_log_timestamp_always=TRUE; | ||
1543 | 4 | [log_start.inc] percona_slow_extended_query_log_1 | ||
1544 | 5 | SELECT 1; | ||
1545 | 6 | 1 | ||
1546 | 7 | 1 | ||
1547 | 8 | SELECT 2; | ||
1548 | 9 | 2 | ||
1549 | 10 | 2 | ||
1550 | 11 | [log_stop.inc] percona_slow_extended_query_log_1 | ||
1551 | 12 | [log_grep.inc] file: percona_slow_extended_query_log_1 pattern: ^# Time: \d{6} (\d| )\d:\d\d:\d\d$ | ||
1552 | 13 | [log_grep.inc] lines: 3 | ||
1553 | 14 | SET GLOBAL slow_query_log_timestamp_always=default; | ||
1554 | 15 | SET SESSION long_query_time=default; | ||
1555 | 16 | SET SESSION min_examined_row_limit=default; | ||
1556 | 0 | 17 | ||
1557 | === removed file 'Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result' | |||
1558 | --- Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result 2012-04-18 23:25:38 +0000 | |||
1559 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_always.result 1970-01-01 00:00:00 +0000 | |||
1560 | @@ -1,41 +0,0 @@ | |||
1561 | 1 | SET long_query_time=2; | ||
1562 | 2 | SET GLOBAL slow_query_log_timestamp_always=ON; | ||
1563 | 3 | [log_start.inc] percona.slow_extended.slow_query_log_timestamp_always | ||
1564 | 4 | SET SESSION query_exec_time=2.1; | ||
1565 | 5 | SELECT 1; | ||
1566 | 6 | 1 | ||
1567 | 7 | 1 | ||
1568 | 8 | SELECT 1; | ||
1569 | 9 | 1 | ||
1570 | 10 | 1 | ||
1571 | 11 | SELECT 1; | ||
1572 | 12 | 1 | ||
1573 | 13 | 1 | ||
1574 | 14 | SET GLOBAL slow_query_log_timestamp_always=OFF; | ||
1575 | 15 | SET SESSION query_exec_time=2.1; | ||
1576 | 16 | SELECT 1; | ||
1577 | 17 | 1 | ||
1578 | 18 | 1 | ||
1579 | 19 | SELECT 1; | ||
1580 | 20 | 1 | ||
1581 | 21 | 1 | ||
1582 | 22 | SELECT 1; | ||
1583 | 23 | 1 | ||
1584 | 24 | 1 | ||
1585 | 25 | SET GLOBAL slow_query_log_timestamp_always=ON; | ||
1586 | 26 | SET SESSION query_exec_time=2.1; | ||
1587 | 27 | SELECT 1; | ||
1588 | 28 | 1 | ||
1589 | 29 | 1 | ||
1590 | 30 | SELECT 1; | ||
1591 | 31 | 1 | ||
1592 | 32 | 1 | ||
1593 | 33 | SELECT 1; | ||
1594 | 34 | 1 | ||
1595 | 35 | 1 | ||
1596 | 36 | SET SESSION query_exec_time=default; | ||
1597 | 37 | [log_stop.inc] percona.slow_extended.slow_query_log_timestamp_always | ||
1598 | 38 | SET GLOBAL slow_query_log_timestamp_always=default; | ||
1599 | 39 | SET long_query_time=default; | ||
1600 | 40 | [log_grep.inc] file: percona.slow_extended.slow_query_log_timestamp_always pattern: # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+ | ||
1601 | 41 | [log_grep.inc] lines: 6 | ||
1602 | 42 | 0 | ||
1603 | === added file 'Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result' | |||
1604 | --- Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result 1970-01-01 00:00:00 +0000 | |||
1605 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result 2013-01-21 06:27:51 +0000 | |||
1606 | @@ -0,0 +1,24 @@ | |||
1607 | 1 | SET @old_slow_query_log_timestamp_always=@@slow_query_log_timestamp_always; | ||
1608 | 2 | SET SESSION min_examined_row_limit=0; | ||
1609 | 3 | SET long_query_time=0; | ||
1610 | 4 | SET GLOBAL slow_query_log_timestamp_always=TRUE; | ||
1611 | 5 | SET GLOBAL slow_query_log_timestamp_precision='microsecond'; | ||
1612 | 6 | [log_start.inc] percona_slow_extended_1 | ||
1613 | 7 | SELECT 1; | ||
1614 | 8 | 1 | ||
1615 | 9 | 1 | ||
1616 | 10 | [log_stop.inc] percona_slow_extended_1 | ||
1617 | 11 | [log_grep.inc] file: percona_slow_extended_1 pattern: ^# Time: \d{6} (\d| )\d:\d\d:\d\d\.\d{6}$ | ||
1618 | 12 | [log_grep.inc] lines: 2 | ||
1619 | 13 | SET GLOBAL slow_query_log_timestamp_precision='second'; | ||
1620 | 14 | [log_start.inc] percona_slow_extended_2 | ||
1621 | 15 | SELECT 1; | ||
1622 | 16 | 1 | ||
1623 | 17 | 1 | ||
1624 | 18 | [log_stop.inc] percona_slow_extended_2 | ||
1625 | 19 | [log_grep.inc] file: percona_slow_extended_2 pattern: ^# Time: \d{6} (\d| )\d:\d\d:\d\d$ | ||
1626 | 20 | [log_grep.inc] lines: 2 | ||
1627 | 21 | SET long_query_time=default; | ||
1628 | 22 | SET SESSION min_examined_row_limit=default; | ||
1629 | 23 | SET GLOBAL slow_query_log_timestamp_always=@old_slow_query_log_timestamp_always; | ||
1630 | 24 | SET GLOBAL slow_query_log_timestamp_precision=default; | ||
1631 | 0 | 25 | ||
1632 | === removed file 'Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result' | |||
1633 | --- Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result 2012-04-18 23:25:38 +0000 | |||
1634 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_timestamp_precision.result 1970-01-01 00:00:00 +0000 | |||
1635 | @@ -1,18 +0,0 @@ | |||
1636 | 1 | SET long_query_time=2; | ||
1637 | 2 | [log_start.inc] percona.slow_extended.slow_query_log_timestamp_precision | ||
1638 | 3 | SET SESSION query_exec_time=2.1; | ||
1639 | 4 | SELECT 1; | ||
1640 | 5 | 1 | ||
1641 | 6 | 1 | ||
1642 | 7 | SET GLOBAL slow_query_log_timestamp_precision='microsecond'; | ||
1643 | 8 | SELECT 1; | ||
1644 | 9 | 1 | ||
1645 | 10 | 1 | ||
1646 | 11 | SET SESSION query_exec_time=default; | ||
1647 | 12 | [log_stop.inc] percona.slow_extended.slow_query_log_timestamp_precision | ||
1648 | 13 | SET GLOBAL slow_query_log_timestamp_precision=default; | ||
1649 | 14 | SET long_query_time=default; | ||
1650 | 15 | [log_grep.inc] file: percona.slow_extended.slow_query_log_timestamp_precision pattern: # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+ | ||
1651 | 16 | [log_grep.inc] lines: 1 | ||
1652 | 17 | [log_grep.inc] file: percona.slow_extended.slow_query_log_timestamp_precision pattern: # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+ | ||
1653 | 18 | [log_grep.inc] lines: 2 | ||
1654 | 19 | 0 | ||
1655 | === added file 'Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result' | |||
1656 | --- Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result 1970-01-01 00:00:00 +0000 | |||
1657 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result 2013-01-21 06:27:51 +0000 | |||
1658 | @@ -0,0 +1,20 @@ | |||
1659 | 1 | SET SESSION min_examined_row_limit=0; | ||
1660 | 2 | SET GLOBAL long_query_time=1; | ||
1661 | 3 | [log_start.inc] percona.slow_extended.slow_query_log_use_global_control | ||
1662 | 4 | SET SESSION query_exec_time=1.1; | ||
1663 | 5 | SELECT 1; | ||
1664 | 6 | 1 | ||
1665 | 7 | 1 | ||
1666 | 8 | SET GLOBAL log_slow_verbosity=innodb; | ||
1667 | 9 | SET GLOBAL slow_query_log_use_global_control="log_slow_verbosity,long_query_time"; | ||
1668 | 10 | SELECT 1; | ||
1669 | 11 | 1 | ||
1670 | 12 | 1 | ||
1671 | 13 | SET SESSION query_exec_time=default; | ||
1672 | 14 | [log_stop.inc] percona.slow_extended.slow_query_log_use_global_control | ||
1673 | 15 | SET GLOBAL slow_query_log_use_global_control=''; | ||
1674 | 16 | SET GLOBAL log_slow_verbosity=''; | ||
1675 | 17 | SET GLOBAL long_query_time=default; | ||
1676 | 18 | SET SESSION min_examined_row_limit=default; | ||
1677 | 19 | [log_grep.inc] file: percona.slow_extended.slow_query_log_use_global_control pattern: No InnoDB statistics available for this query | ||
1678 | 20 | [log_grep.inc] lines: 1 | ||
1679 | 0 | 21 | ||
1680 | === removed file 'Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result' | |||
1681 | --- Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result 2012-04-18 23:25:38 +0000 | |||
1682 | +++ Percona-Server/mysql-test/r/percona_slow_query_log_use_global_control.result 1970-01-01 00:00:00 +0000 | |||
1683 | @@ -1,18 +0,0 @@ | |||
1684 | 1 | SET GLOBAL long_query_time=1; | ||
1685 | 2 | [log_start.inc] percona.slow_extended.slow_query_log_use_global_control | ||
1686 | 3 | SET SESSION query_exec_time=1.1; | ||
1687 | 4 | SELECT 1; | ||
1688 | 5 | 1 | ||
1689 | 6 | 1 | ||
1690 | 7 | SET GLOBAL log_slow_verbosity=innodb; | ||
1691 | 8 | SET GLOBAL slow_query_log_use_global_control="log_slow_verbosity,long_query_time"; | ||
1692 | 9 | SELECT 1; | ||
1693 | 10 | 1 | ||
1694 | 11 | 1 | ||
1695 | 12 | SET SESSION query_exec_time=default; | ||
1696 | 13 | [log_stop.inc] percona.slow_extended.slow_query_log_use_global_control | ||
1697 | 14 | SET GLOBAL slow_query_log_use_global_control=default; | ||
1698 | 15 | SET GLOBAL log_slow_verbosity=default; | ||
1699 | 16 | SET GLOBAL long_query_time=default; | ||
1700 | 17 | [log_grep.inc] file: percona.slow_extended.slow_query_log_use_global_control pattern: No InnoDB statistics available for this query | ||
1701 | 18 | [log_grep.inc] lines: 1 | ||
1702 | 19 | 0 | ||
1703 | === modified file 'Percona-Server/mysql-test/t/disabled.def' | |||
1704 | --- Percona-Server/mysql-test/t/disabled.def 2012-05-10 07:49:14 +0000 | |||
1705 | +++ Percona-Server/mysql-test/t/disabled.def 2013-01-21 06:27:51 +0000 | |||
1706 | @@ -15,3 +15,4 @@ | |||
1707 | 15 | archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc | 15 | archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc |
1708 | 16 | log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists | 16 | log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists |
1709 | 17 | mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 | 17 | mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 |
1710 | 18 | percona_slow_extended_error_on_quit : https://bugs.launchpad.net/percona-server/+bug/1098857 2013-01-12 laurynas | ||
1711 | 18 | 19 | ||
1712 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test' | |||
1713 | --- Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test 1970-01-01 00:00:00 +0000 | |||
1714 | +++ Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test 2013-01-21 06:27:51 +0000 | |||
1715 | @@ -0,0 +1,41 @@ | |||
1716 | 1 | # | ||
1717 | 2 | # Test log_slow_slave_admin_statements | ||
1718 | 3 | # | ||
1719 | 4 | |||
1720 | 5 | --disable_warnings | ||
1721 | 6 | DROP TABLE IF EXISTS t1; | ||
1722 | 7 | --enable_warnings | ||
1723 | 8 | |||
1724 | 9 | CREATE TABLE t1 (a INT); | ||
1725 | 10 | |||
1726 | 11 | SET SESSION min_examined_row_limit=0; | ||
1727 | 12 | SET SESSION long_query_time=0; | ||
1728 | 13 | |||
1729 | 14 | # | ||
1730 | 15 | # Test enabled admin statement slow-logging | ||
1731 | 16 | # | ||
1732 | 17 | SET GLOBAL log_slow_admin_statements=ON; | ||
1733 | 18 | --let log_file=percona_log_slow_admin_stmt_1 | ||
1734 | 19 | --source include/log_start.inc | ||
1735 | 20 | ALTER TABLE t1 ADD INDEX a(a); | ||
1736 | 21 | --source include/log_stop.inc | ||
1737 | 22 | --let grep_pattern=ALTER TABLE t1 ADD INDEX a\(a\); | ||
1738 | 23 | --source include/log_grep.inc | ||
1739 | 24 | |||
1740 | 25 | # | ||
1741 | 26 | # Test disabled admin statement slow-logging | ||
1742 | 27 | # | ||
1743 | 28 | SET GLOBAL log_slow_admin_statements=OFF; | ||
1744 | 29 | --let log_file=percona_log_slow_admin_stmt_2 | ||
1745 | 30 | --source include/log_start.inc | ||
1746 | 31 | ALTER TABLE t1 DROP INDEX a; | ||
1747 | 32 | --source include/log_stop.inc | ||
1748 | 33 | --let grep_pattern=ALTER TABLE t1 DROP INDEX a; | ||
1749 | 34 | --source include/log_grep.inc | ||
1750 | 35 | |||
1751 | 36 | SET GLOBAL log_slow_admin_statements=default; | ||
1752 | 37 | SET SESSION long_query_time=default; | ||
1753 | 38 | SET SESSION min_examined_row_limit=default; | ||
1754 | 39 | |||
1755 | 40 | DROP TABLE t1; | ||
1756 | 41 | --source include/log_cleanup.inc | ||
1757 | 0 | 42 | ||
1758 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test' | |||
1759 | --- Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test 2012-04-18 23:25:38 +0000 | |||
1760 | +++ Percona-Server/mysql-test/t/percona_log_slow_admin_statements.test 1970-01-01 00:00:00 +0000 | |||
1761 | @@ -1,20 +0,0 @@ | |||
1762 | 1 | # default value | ||
1763 | 2 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
1764 | 3 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
1765 | 4 | # set value to 'true' | ||
1766 | 5 | SET GLOBAL log_slow_admin_statements=true; | ||
1767 | 6 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
1768 | 7 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
1769 | 8 | # set value to 'false' | ||
1770 | 9 | SET GLOBAL log_slow_admin_statements=false; | ||
1771 | 10 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
1772 | 11 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
1773 | 12 | # set value to 'foo' | ||
1774 | 13 | --error ER_WRONG_VALUE_FOR_VAR | ||
1775 | 14 | SET GLOBAL log_slow_admin_statements=foo; | ||
1776 | 15 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
1777 | 16 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
1778 | 17 | # set value to default | ||
1779 | 18 | SET GLOBAL log_slow_admin_statements=default; | ||
1780 | 19 | SHOW GLOBAL VARIABLES like 'log_slow_admin_statements'; | ||
1781 | 20 | SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_slow_admin_statements'; | ||
1782 | 21 | 0 | ||
1783 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_filter.test' | |||
1784 | --- Percona-Server/mysql-test/t/percona_log_slow_filter.test 2012-04-18 23:25:38 +0000 | |||
1785 | +++ Percona-Server/mysql-test/t/percona_log_slow_filter.test 1970-01-01 00:00:00 +0000 | |||
1786 | @@ -1,26 +0,0 @@ | |||
1787 | 1 | --source include/have_debug.inc | ||
1788 | 2 | |||
1789 | 3 | CREATE TABLE t(id INT PRIMARY KEY); | ||
1790 | 4 | INSERT INTO t VALUES(1); | ||
1791 | 5 | INSERT INTO t VALUES(2); | ||
1792 | 6 | INSERT INTO t VALUES(3); | ||
1793 | 7 | |||
1794 | 8 | SET long_query_time=1; | ||
1795 | 9 | SET log_slow_filter=full_join; | ||
1796 | 10 | --let log_file=percona.slow_extended.log_slow_filter | ||
1797 | 11 | --source include/log_start.inc | ||
1798 | 12 | |||
1799 | 13 | SET query_exec_time = 1.1; | ||
1800 | 14 | --disable_result_log | ||
1801 | 15 | SELECT * FROM t AS t1, t AS t2; | ||
1802 | 16 | --enable_result_log | ||
1803 | 17 | SET query_exec_time = default; | ||
1804 | 18 | |||
1805 | 19 | --source include/log_stop.inc | ||
1806 | 20 | SET log_slow_filter=default; | ||
1807 | 21 | SET long_query_time=default; | ||
1808 | 22 | |||
1809 | 23 | --let grep_pattern = Query_time | ||
1810 | 24 | --source include/log_grep.inc | ||
1811 | 25 | |||
1812 | 26 | DROP TABLE t; | ||
1813 | 27 | 0 | ||
1814 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_innodb.test' | |||
1815 | --- Percona-Server/mysql-test/t/percona_log_slow_innodb.test 1970-01-01 00:00:00 +0000 | |||
1816 | +++ Percona-Server/mysql-test/t/percona_log_slow_innodb.test 2013-01-21 06:27:51 +0000 | |||
1817 | @@ -0,0 +1,82 @@ | |||
1818 | 1 | # | ||
1819 | 2 | # Test that InnoDB stats for the extended slow query log are collected. | ||
1820 | 3 | # We do not parse the log to see that the values are reasonable. That should be done after log to table is implemented. | ||
1821 | 4 | # We also do not test the stats that would require DEBUG_SYNC: InnoDB_queue_wait and InnoDB_rec_lock_wait. The latter is | ||
1822 | 5 | # "tested" with SLEEP here, but this is not guaranteed to work. The testcase is not unstable because of this as we don't | ||
1823 | 6 | # actually check the value. | ||
1824 | 7 | # | ||
1825 | 8 | --source include/have_innodb.inc | ||
1826 | 9 | |||
1827 | 10 | --disable_warnings | ||
1828 | 11 | DROP TABLE IF EXISTS t1, t2; | ||
1829 | 12 | --enable_warnings | ||
1830 | 13 | |||
1831 | 14 | let $MYSQLD_TMPDIR = `SELECT @@tmpdir`; | ||
1832 | 15 | let $MYSQLD_DATADIR = `SELECT @@datadir`; | ||
1833 | 16 | |||
1834 | 17 | CREATE TABLE t1(a INT) ENGINE=InnoDB; | ||
1835 | 18 | INSERT INTO t1 VALUE(1); | ||
1836 | 19 | |||
1837 | 20 | CREATE TABLE t2(a INT) ENGINE=InnoDB; | ||
1838 | 21 | INSERT INTO t2 VALUE(1); | ||
1839 | 22 | |||
1840 | 23 | # Force cold buffer pool | ||
1841 | 24 | --source include/restart_mysqld.inc | ||
1842 | 25 | |||
1843 | 26 | SET SESSION min_examined_row_limit=0; | ||
1844 | 27 | SET SESSION long_query_time=0; | ||
1845 | 28 | SET @old_log_slow_verbosity := @@log_slow_verbosity; | ||
1846 | 29 | SET SESSION log_slow_verbosity='microtime,innodb'; | ||
1847 | 30 | |||
1848 | 31 | --let log_file=percona.slow_extended.innodb_0 | ||
1849 | 32 | --source include/log_start.inc | ||
1850 | 33 | INSERT INTO t1 VALUES(2); | ||
1851 | 34 | INSERT INTO t2 VALUES(2); | ||
1852 | 35 | INSERT INTO t1 VALUES(3); # Pages in the buffer pool already | ||
1853 | 36 | SELECT 5; # No InnoDB pages accessed | ||
1854 | 37 | --source include/log_stop.inc | ||
1855 | 38 | |||
1856 | 39 | # | ||
1857 | 40 | # Table lock waits | ||
1858 | 41 | # | ||
1859 | 42 | |||
1860 | 43 | LOCK TABLE t1 WRITE; | ||
1861 | 44 | --connect (con2,localhost,root,,test,,) | ||
1862 | 45 | --connection con2 | ||
1863 | 46 | --let log_file=percona.slow_extended.innodb_3 | ||
1864 | 47 | --source include/log_start.inc | ||
1865 | 48 | send LOCK TABLE t1 WRITE; | ||
1866 | 49 | --connection default | ||
1867 | 50 | # TODO: best-effort test for now. A bug if we check the actual lock time! | ||
1868 | 51 | SELECT SLEEP(5); | ||
1869 | 52 | UNLOCK TABLES; | ||
1870 | 53 | --connection con2 | ||
1871 | 54 | reap; | ||
1872 | 55 | --source include/log_stop.inc | ||
1873 | 56 | UNLOCK TABLES; | ||
1874 | 57 | --connection default | ||
1875 | 58 | |||
1876 | 59 | # | ||
1877 | 60 | # Row lock waits | ||
1878 | 61 | # | ||
1879 | 62 | BEGIN; | ||
1880 | 63 | SELECT * FROM t2 FOR UPDATE; | ||
1881 | 64 | --connection con2 | ||
1882 | 65 | --let log_file=percona.slow_extended.innodb_4 | ||
1883 | 66 | --source include/log_start.inc | ||
1884 | 67 | send DELETE FROM t2 WHERE a=2; | ||
1885 | 68 | --connection default | ||
1886 | 69 | SELECT SLEEP(5); | ||
1887 | 70 | COMMIT; | ||
1888 | 71 | --connection con2 | ||
1889 | 72 | reap; | ||
1890 | 73 | --source include/log_stop.inc | ||
1891 | 74 | --disconnect con2 | ||
1892 | 75 | --connection default | ||
1893 | 76 | |||
1894 | 77 | SET SESSION min_examined_row_limit=default; | ||
1895 | 78 | SET SESSION long_query_time=default; | ||
1896 | 79 | SET SESSION log_slow_verbosity=@old_log_slow_verbosity; | ||
1897 | 80 | |||
1898 | 81 | DROP TABLE t1, t2; | ||
1899 | 82 | --source include/log_cleanup.inc | ||
1900 | 0 | 83 | ||
1901 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_query_plan.test' | |||
1902 | --- Percona-Server/mysql-test/t/percona_log_slow_query_plan.test 1970-01-01 00:00:00 +0000 | |||
1903 | +++ Percona-Server/mysql-test/t/percona_log_slow_query_plan.test 2013-01-21 06:27:51 +0000 | |||
1904 | @@ -0,0 +1,302 @@ | |||
1905 | 1 | # | ||
1906 | 2 | # Test that various query plans are logged correctly in the slow query log. | ||
1907 | 3 | # | ||
1908 | 4 | --source include/have_innodb.inc | ||
1909 | 5 | |||
1910 | 6 | FLUSH STATUS; | ||
1911 | 7 | |||
1912 | 8 | --disable_warnings | ||
1913 | 9 | DROP TABLE IF EXISTS t1; | ||
1914 | 10 | --enable_warnings | ||
1915 | 11 | |||
1916 | 12 | CREATE TABLE t1( | ||
1917 | 13 | a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
1918 | 14 | b INT) ENGINE=InnoDB; | ||
1919 | 15 | |||
1920 | 16 | INSERT INTO t1 VALUES(NULL, 10), (NULL, 5); | ||
1921 | 17 | |||
1922 | 18 | SET SESSION long_query_time=0; | ||
1923 | 19 | SET SESSION min_examined_row_limit=0; | ||
1924 | 20 | SET SESSION log_slow_verbosity='microtime,query_plan'; | ||
1925 | 21 | |||
1926 | 22 | # | ||
1927 | 23 | # filesort, disk filesort, and filesort merge passes negative test | ||
1928 | 24 | # | ||
1929 | 25 | EXPLAIN SELECT * FROM t1; | ||
1930 | 26 | --let log_file=percona_slow_query_log.query_plan_0 | ||
1931 | 27 | --source include/log_start.inc | ||
1932 | 28 | SELECT * FROM t1; | ||
1933 | 29 | --source include/log_stop.inc | ||
1934 | 30 | --let grep_pattern = ^# Filesort: No Filesort_on_disk: No Merge_passes: 0\$ | ||
1935 | 31 | --source include/log_grep.inc | ||
1936 | 32 | |||
1937 | 33 | # | ||
1938 | 34 | # filesort positive test, memory, zero merge passes | ||
1939 | 35 | # | ||
1940 | 36 | EXPLAIN SELECT * FROM t1 ORDER BY b; | ||
1941 | 37 | --let log_file=percona_slow_query_log.query_plan_1 | ||
1942 | 38 | --source include/log_start.inc | ||
1943 | 39 | SELECT * FROM t1 ORDER BY b; | ||
1944 | 40 | --source include/log_stop.inc | ||
1945 | 41 | --let grep_pattern = ^# Filesort: Yes Filesort_on_disk: No Merge_passes: 0\$ | ||
1946 | 42 | --source include/log_grep.inc | ||
1947 | 43 | |||
1948 | 44 | # | ||
1949 | 45 | # Same as above but filtered away | ||
1950 | 46 | # | ||
1951 | 47 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort_on_disk'; | ||
1952 | 48 | --let log_file=percona_slow_query_log.query_plan_1a | ||
1953 | 49 | --source include/log_start.inc | ||
1954 | 50 | SELECT * FROM t1 ORDER BY b; | ||
1955 | 51 | --source include/log_stop.inc | ||
1956 | 52 | --let grep_pattern = ^# Filesort: Yes Filesort_on_disk: No Merge_passes: 0\$ | ||
1957 | 53 | --source include/log_grep.inc | ||
1958 | 54 | SET SESSION log_slow_filter=default; | ||
1959 | 55 | |||
1960 | 56 | # | ||
1961 | 57 | # filesort positive test, disk, one merge pass | ||
1962 | 58 | # | ||
1963 | 59 | SET SESSION sort_buffer_size=32804; | ||
1964 | 60 | CREATE TABLE t2 (a INT) ENGINE=InnoDB; | ||
1965 | 61 | INSERT INTO t2 VALUES (5), (16), (2), (17), (1); | ||
1966 | 62 | INSERT INTO t2 SELECT * FROM t2; | ||
1967 | 63 | INSERT INTO t2 SELECT * FROM t2; | ||
1968 | 64 | INSERT INTO t2 SELECT * FROM t2; | ||
1969 | 65 | INSERT INTO t2 SELECT * FROM t2; | ||
1970 | 66 | INSERT INTO t2 SELECT * FROM t2; | ||
1971 | 67 | INSERT INTO t2 SELECT * FROM t2; | ||
1972 | 68 | INSERT INTO t2 SELECT * FROM t2; | ||
1973 | 69 | INSERT INTO t2 SELECT * FROM t2; | ||
1974 | 70 | INSERT INTO t2 SELECT * FROM t2; | ||
1975 | 71 | |||
1976 | 72 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
1977 | 73 | --replace_column 9 ROWS | ||
1978 | 74 | EXPLAIN SELECT * FROM t2 ORDER BY a; | ||
1979 | 75 | |||
1980 | 76 | --let log_file=percona_slow_query_log.query_plan_2 | ||
1981 | 77 | --source include/log_start.inc | ||
1982 | 78 | --disable_result_log | ||
1983 | 79 | SELECT * FROM t2 ORDER BY a; | ||
1984 | 80 | --enable_result_log | ||
1985 | 81 | --source include/log_stop.inc | ||
1986 | 82 | --let grep_pattern = ^# Filesort: Yes Filesort_on_disk: Yes Merge_passes: 1\$ | ||
1987 | 83 | --source include/log_grep.inc | ||
1988 | 84 | |||
1989 | 85 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
1990 | 86 | |||
1991 | 87 | # | ||
1992 | 88 | # Same as above but filtered away | ||
1993 | 89 | # | ||
1994 | 90 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk'; | ||
1995 | 91 | --let log_file=percona_slow_query_log.query_plan_2a | ||
1996 | 92 | --source include/log_start.inc | ||
1997 | 93 | --disable_result_log | ||
1998 | 94 | SELECT * FROM t2 ORDER BY a; | ||
1999 | 95 | --enable_result_log | ||
2000 | 96 | --source include/log_stop.inc | ||
2001 | 97 | --let grep_pattern = ^# Filesort: Yes Filesort_on_disk: Yes Merge_passes: 1\$ | ||
2002 | 98 | --source include/log_grep.inc | ||
2003 | 99 | |||
2004 | 100 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
2005 | 101 | |||
2006 | 102 | SET SESSION log_slow_filter=default; | ||
2007 | 103 | |||
2008 | 104 | # | ||
2009 | 105 | # Same as the above, with more than one merge pass | ||
2010 | 106 | # | ||
2011 | 107 | INSERT INTO t2 SELECT * FROM t2; | ||
2012 | 108 | INSERT INTO t2 SELECT * FROM t2; | ||
2013 | 109 | INSERT INTO t2 SELECT * FROM t2; | ||
2014 | 110 | INSERT INTO t2 SELECT * FROM t2; | ||
2015 | 111 | --let log_file=percona_slow_query_log.query_plan_3 | ||
2016 | 112 | --source include/log_start.inc | ||
2017 | 113 | --disable_result_log | ||
2018 | 114 | SELECT * FROM t2 ORDER BY a; | ||
2019 | 115 | --enable_result_log | ||
2020 | 116 | --source include/log_stop.inc | ||
2021 | 117 | --let grep_pattern = ^# Filesort: Yes Filesort_on_disk: Yes Merge_passes: 4\$ | ||
2022 | 118 | --source include/log_grep.inc | ||
2023 | 119 | |||
2024 | 120 | SHOW SESSION STATUS LIKE 'Sort_merge_passes'; | ||
2025 | 121 | |||
2026 | 122 | SET SESSION sort_buffer_size=default; | ||
2027 | 123 | |||
2028 | 124 | # | ||
2029 | 125 | # Full_scan, negative test | ||
2030 | 126 | # | ||
2031 | 127 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
2032 | 128 | --let log_file=percona_slow_query_log.query_plan_4 | ||
2033 | 129 | --source include/log_start.inc | ||
2034 | 130 | SELECT * FROM t1 WHERE a=1; | ||
2035 | 131 | --source include/log_stop.inc | ||
2036 | 132 | --let grep_pattern = ^#.*Full_scan: No.*\$ | ||
2037 | 133 | --source include/log_grep.inc | ||
2038 | 134 | |||
2039 | 135 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
2040 | 136 | |||
2041 | 137 | # | ||
2042 | 138 | # Full_scan, positive test | ||
2043 | 139 | # | ||
2044 | 140 | --let log_file=percona_slow_query_log.query_plan_5 | ||
2045 | 141 | --source include/log_start.inc | ||
2046 | 142 | SELECT COUNT(*) FROM t1; | ||
2047 | 143 | --source include/log_stop.inc | ||
2048 | 144 | --let grep_pattern = ^#.*Full_scan: Yes.*\$ | ||
2049 | 145 | --source include/log_grep.inc | ||
2050 | 146 | |||
2051 | 147 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
2052 | 148 | |||
2053 | 149 | # | ||
2054 | 150 | # Same as above, but filtered away | ||
2055 | 151 | # | ||
2056 | 152 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; | ||
2057 | 153 | --let log_file=percona_slow_query_log.query_plan_5a | ||
2058 | 154 | --source include/log_start.inc | ||
2059 | 155 | SELECT COUNT(*) FROM t1; | ||
2060 | 156 | --source include/log_stop.inc | ||
2061 | 157 | --let grep_pattern = ^#.*Full_scan: Yes.*\$ | ||
2062 | 158 | --source include/log_grep.inc | ||
2063 | 159 | |||
2064 | 160 | SHOW SESSION STATUS LIKE 'Select_scan'; | ||
2065 | 161 | |||
2066 | 162 | SET SESSION log_slow_filter=default; | ||
2067 | 163 | |||
2068 | 164 | # | ||
2069 | 165 | # Full_join, negative test | ||
2070 | 166 | # | ||
2071 | 167 | CREATE TABLE t3(a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; | ||
2072 | 168 | INSERT INTO t3 VALUES (1), (2), (3); | ||
2073 | 169 | |||
2074 | 170 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
2075 | 171 | --let log_file=percona_slow_query_log.query_plan_6 | ||
2076 | 172 | --source include/log_start.inc | ||
2077 | 173 | SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a; | ||
2078 | 174 | --source include/log_stop.inc | ||
2079 | 175 | --let grep_pattern = ^#.*Full_join: No.*\$ | ||
2080 | 176 | --source include/log_grep.inc | ||
2081 | 177 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
2082 | 178 | |||
2083 | 179 | # | ||
2084 | 180 | # Full_join, positive test | ||
2085 | 181 | # | ||
2086 | 182 | --let log_file=percona_slow_query_log.query_plan_7 | ||
2087 | 183 | --source include/log_start.inc | ||
2088 | 184 | SELECT COUNT(*) FROM t1, t2 WHERE t1.b = t2.a; | ||
2089 | 185 | --source include/log_stop.inc | ||
2090 | 186 | --let grep_pattern = ^#.*Full_join: Yes.*\$ | ||
2091 | 187 | --source include/log_grep.inc | ||
2092 | 188 | |||
2093 | 189 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
2094 | 190 | |||
2095 | 191 | # | ||
2096 | 192 | # Same as above, but filtered away | ||
2097 | 193 | # | ||
2098 | 194 | SET SESSION log_slow_filter='tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; | ||
2099 | 195 | --let log_file=percona_slow_query_log.query_plan_7a | ||
2100 | 196 | --source include/log_start.inc | ||
2101 | 197 | SELECT COUNT(*) FROM t1, t2 WHERE t1.b = t2.a; | ||
2102 | 198 | --source include/log_stop.inc | ||
2103 | 199 | --let grep_pattern = ^#.*Full_join: Yes.*\$ | ||
2104 | 200 | --source include/log_grep.inc | ||
2105 | 201 | |||
2106 | 202 | SHOW SESSION STATUS LIKE 'Select_full_join'; | ||
2107 | 203 | |||
2108 | 204 | SET SESSION log_slow_filter=default; | ||
2109 | 205 | |||
2110 | 206 | # | ||
2111 | 207 | # Tmp_table and Tmp_table_on_disk negative test | ||
2112 | 208 | # | ||
2113 | 209 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
2114 | 210 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
2115 | 211 | EXPLAIN SELECT COUNT(*) FROM t1; | ||
2116 | 212 | --let log_file=percona_slow_query_log.query_plan_8 | ||
2117 | 213 | --source include/log_start.inc | ||
2118 | 214 | SELECT COUNT(*) FROM t1; | ||
2119 | 215 | --source include/log_stop.inc | ||
2120 | 216 | --let grep_pattern = ^#.*Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0\$ | ||
2121 | 217 | --source include/log_grep.inc | ||
2122 | 218 | --let grep_pattern = ^#.*Tmp_table: No Tmp_table_on_disk: No\$ | ||
2123 | 219 | --source include/log_grep.inc | ||
2124 | 220 | |||
2125 | 221 | # | ||
2126 | 222 | # Tmp_table positive, Tmp_table_on_disk negative test | ||
2127 | 223 | # | ||
2128 | 224 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
2129 | 225 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
2130 | 226 | |||
2131 | 227 | EXPLAIN SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a GROUP BY t3.a; | ||
2132 | 228 | --let log_file=percona_slow_query_log.query_plan_9 | ||
2133 | 229 | --source include/log_start.inc | ||
2134 | 230 | SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a GROUP BY t3.a; | ||
2135 | 231 | --source include/log_stop.inc | ||
2136 | 232 | --let grep_pattern = ^#.*Tmp_tables: 1 Tmp_disk_tables: 0 Tmp_table_sizes: [1-9][0-9]*\$ | ||
2137 | 233 | --source include/log_grep.inc | ||
2138 | 234 | --let grep_pattern = ^#.*Tmp_table: Yes Tmp_table_on_disk: No\$ | ||
2139 | 235 | --source include/log_grep.inc | ||
2140 | 236 | |||
2141 | 237 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
2142 | 238 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
2143 | 239 | |||
2144 | 240 | # | ||
2145 | 241 | # Same as above but filtered away | ||
2146 | 242 | # | ||
2147 | 243 | SET SESSION log_slow_filter='full_join,tmp_table_on_disk,filesort_on_disk'; | ||
2148 | 244 | |||
2149 | 245 | --let log_file=percona_slow_query_log.query_plan_9a | ||
2150 | 246 | --source include/log_start.inc | ||
2151 | 247 | SELECT COUNT(*) FROM t1, t3 WHERE t1.a = t3.a GROUP BY t3.a; | ||
2152 | 248 | --source include/log_stop.inc | ||
2153 | 249 | --let grep_pattern = ^#.*Tmp_tables: 1 Tmp_disk_tables: 0 Tmp_table_sizes: [1-9][0-9]*\$ | ||
2154 | 250 | --source include/log_grep.inc | ||
2155 | 251 | --let grep_pattern = ^#.*Tmp_table: Yes Tmp_table_on_disk: No\$ | ||
2156 | 252 | --source include/log_grep.inc | ||
2157 | 253 | |||
2158 | 254 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
2159 | 255 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
2160 | 256 | |||
2161 | 257 | SET SESSION log_slow_filter=default; | ||
2162 | 258 | |||
2163 | 259 | # | ||
2164 | 260 | # Tmp_table and Tmp_table_on_disk positive test | ||
2165 | 261 | # | ||
2166 | 262 | CREATE TABLE t4(a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; | ||
2167 | 263 | INSERT INTO t4 VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"); | ||
2168 | 264 | |||
2169 | 265 | EXPLAIN SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.a; | ||
2170 | 266 | --let log_file=percona_slow_query_log.query_plan_10 | ||
2171 | 267 | --source include/log_start.inc | ||
2172 | 268 | SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.b; | ||
2173 | 269 | --source include/log_stop.inc | ||
2174 | 270 | --let grep_pattern = ^#.*Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: [1-9][0-9]*\$ | ||
2175 | 271 | --source include/log_grep.inc | ||
2176 | 272 | --let grep_pattern = ^#.*Tmp_table: Yes Tmp_table_on_disk: Yes\$ | ||
2177 | 273 | --source include/log_grep.inc | ||
2178 | 274 | |||
2179 | 275 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
2180 | 276 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
2181 | 277 | |||
2182 | 278 | # | ||
2183 | 279 | # Same as above but filtered away | ||
2184 | 280 | # | ||
2185 | 281 | SET SESSION log_slow_filter='full_join,filesort_on_disk'; | ||
2186 | 282 | |||
2187 | 283 | --let log_file=percona_slow_query_log.query_plan_10a | ||
2188 | 284 | --source include/log_start.inc | ||
2189 | 285 | SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.b; | ||
2190 | 286 | --source include/log_stop.inc | ||
2191 | 287 | --let grep_pattern = ^#.*Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: [1-9][0-9]*\$ | ||
2192 | 288 | --source include/log_grep.inc | ||
2193 | 289 | --let grep_pattern = ^#.*Tmp_table: Yes Tmp_table_on_disk: Yes\$ | ||
2194 | 290 | --source include/log_grep.inc | ||
2195 | 291 | |||
2196 | 292 | SHOW SESSION STATUS LIKE 'Created_tmp_tables'; | ||
2197 | 293 | SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; | ||
2198 | 294 | |||
2199 | 295 | SET SESSION log_slow_filter=default; | ||
2200 | 296 | |||
2201 | 297 | SET SESSION long_query_time=default; | ||
2202 | 298 | SET SESSION min_examined_row_limit=default; | ||
2203 | 299 | SET SESSION log_slow_verbosity=default; | ||
2204 | 300 | |||
2205 | 301 | DROP TABLE t1, t2, t3, t4; | ||
2206 | 302 | --source include/log_cleanup.inc | ||
2207 | 0 | 303 | ||
2208 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_query_plan_qc.test' | |||
2209 | --- Percona-Server/mysql-test/t/percona_log_slow_query_plan_qc.test 1970-01-01 00:00:00 +0000 | |||
2210 | +++ Percona-Server/mysql-test/t/percona_log_slow_query_plan_qc.test 2013-01-21 06:27:51 +0000 | |||
2211 | @@ -0,0 +1,71 @@ | |||
2212 | 1 | # | ||
2213 | 2 | # Tests the query cache logging for the extended slow query log | ||
2214 | 3 | # | ||
2215 | 4 | --source include/have_innodb.inc | ||
2216 | 5 | --source include/have_query_cache.inc | ||
2217 | 6 | |||
2218 | 7 | FLUSH STATUS; | ||
2219 | 8 | SET SESSION min_examined_row_limit=0; | ||
2220 | 9 | |||
2221 | 10 | --disable_warnings | ||
2222 | 11 | DROP TABLE IF EXISTS t1; | ||
2223 | 12 | --enable_warnings | ||
2224 | 13 | |||
2225 | 14 | CREATE TABLE t1 (a INT) ENGINE=InnoDB; | ||
2226 | 15 | |||
2227 | 16 | INSERT INTO t1 VALUE(5); | ||
2228 | 17 | |||
2229 | 18 | SET SESSION query_cache_type=1; | ||
2230 | 19 | SET GLOBAL query_cache_size=1355776; | ||
2231 | 20 | |||
2232 | 21 | SET SESSION long_query_time=0; | ||
2233 | 22 | SET SESSION log_slow_verbosity='microtime,query_plan'; | ||
2234 | 23 | |||
2235 | 24 | # | ||
2236 | 25 | # Test uncached query | ||
2237 | 26 | # | ||
2238 | 27 | --let log_file = percona_slow_query_log.query_plan_qc_1 | ||
2239 | 28 | --source include/log_start.inc | ||
2240 | 29 | SELECT * FROM t1; | ||
2241 | 30 | --source include/log_stop.inc | ||
2242 | 31 | --let grep_pattern = ^# QC_Hit: No.*\$ | ||
2243 | 32 | --source include/log_grep.inc | ||
2244 | 33 | |||
2245 | 34 | SHOW STATUS LIKE 'Qcache_hits'; | ||
2246 | 35 | |||
2247 | 36 | # | ||
2248 | 37 | # Test cached query | ||
2249 | 38 | # | ||
2250 | 39 | |||
2251 | 40 | --let log_file = percona_slow_query_log.query_plan_qc_2 | ||
2252 | 41 | --source include/log_start.inc | ||
2253 | 42 | SELECT * FROM t1; | ||
2254 | 43 | --source include/log_stop.inc | ||
2255 | 44 | --let grep_pattern = ^# QC_Hit: Yes.*\$ | ||
2256 | 45 | --source include/log_grep.inc | ||
2257 | 46 | |||
2258 | 47 | SHOW STATUS LIKE 'Qcache_hits'; | ||
2259 | 48 | |||
2260 | 49 | # | ||
2261 | 50 | # Test uncached query that is filtered away | ||
2262 | 51 | # | ||
2263 | 52 | SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; | ||
2264 | 53 | --let log_file = percona_slow_query_log.query_plan_qc_3 | ||
2265 | 54 | --source include/log_start.inc | ||
2266 | 55 | SELECT * FROM t1 WHERE a > 5; | ||
2267 | 56 | --source include/log_stop.inc | ||
2268 | 57 | --let grep_pattern = ^# QC_Hit: No.*\$ | ||
2269 | 58 | --source include/log_grep.inc | ||
2270 | 59 | |||
2271 | 60 | SHOW STATUS LIKE 'Qcache_hits'; | ||
2272 | 61 | |||
2273 | 62 | SET SESSION log_slow_filter=default; | ||
2274 | 63 | |||
2275 | 64 | SET SESSION long_query_time=default; | ||
2276 | 65 | SET SESSION log_slow_verbosity=default; | ||
2277 | 66 | SET SESSION query_cache_type=default; | ||
2278 | 67 | SET GLOBAL query_cache_size=default; | ||
2279 | 68 | SET SESSION min_examined_row_limit=default; | ||
2280 | 69 | |||
2281 | 70 | DROP TABLE t1; | ||
2282 | 71 | --source include/log_cleanup.inc | ||
2283 | 0 | 72 | ||
2284 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb-slave.opt' | |||
2285 | --- Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb-slave.opt 2012-04-18 23:25:38 +0000 | |||
2286 | +++ Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb-slave.opt 1970-01-01 00:00:00 +0000 | |||
2287 | @@ -1,1 +0,0 @@ | |||
2288 | 1 | --long_query_time=0 --log_slow_slave_statements --log_slow_verbosity=innodb | ||
2289 | 2 | \ No newline at end of file | 0 | \ No newline at end of file |
2290 | 3 | 1 | ||
2291 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test' | |||
2292 | --- Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test 1970-01-01 00:00:00 +0000 | |||
2293 | +++ Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test 2013-01-21 06:27:51 +0000 | |||
2294 | @@ -0,0 +1,48 @@ | |||
2295 | 1 | --source include/have_binlog_format_statement.inc | ||
2296 | 2 | --source include/master-slave.inc | ||
2297 | 3 | --source include/have_innodb.inc | ||
2298 | 4 | |||
2299 | 5 | SET SESSION min_examined_row_limit=0; | ||
2300 | 6 | -- disable_warnings | ||
2301 | 7 | DROP TABLE IF EXISTS t; | ||
2302 | 8 | -- enable_warnings | ||
2303 | 9 | |||
2304 | 10 | CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB; | ||
2305 | 11 | INSERT INTO t VALUES | ||
2306 | 12 | (1,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2307 | 13 | (2,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2308 | 14 | (3,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2309 | 15 | (4,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2310 | 16 | (5,"aaaaabbbbbcccccdddddeeeeefffff"); | ||
2311 | 17 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
2312 | 18 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
2313 | 19 | sync_slave_with_master; | ||
2314 | 20 | |||
2315 | 21 | SET GLOBAL long_query_time=0; | ||
2316 | 22 | SET GLOBAL log_slow_slave_statements=TRUE; | ||
2317 | 23 | SET GLOBAL log_slow_verbosity='innodb'; | ||
2318 | 24 | --source include/restart_slave_sql.inc | ||
2319 | 25 | |||
2320 | 26 | --let log_file=percona.slow_extended.log_slow_slave_statements-innodb | ||
2321 | 27 | |||
2322 | 28 | --source include/log_start.inc | ||
2323 | 29 | connection master; | ||
2324 | 30 | INSERT INTO t SELECT t.id,t.data from t; | ||
2325 | 31 | sync_slave_with_master; | ||
2326 | 32 | --source include/log_stop.inc | ||
2327 | 33 | |||
2328 | 34 | --let grep_pattern = InnoDB_IO_r_ops | ||
2329 | 35 | --source include/log_grep.inc | ||
2330 | 36 | |||
2331 | 37 | connection master; | ||
2332 | 38 | DROP TABLE t; | ||
2333 | 39 | sync_slave_with_master; | ||
2334 | 40 | |||
2335 | 41 | SET GLOBAL long_query_time=default; | ||
2336 | 42 | SET GLOBAL log_slow_slave_statements=default; | ||
2337 | 43 | SET GLOBAL log_slow_verbosity=default; | ||
2338 | 44 | SET SESSION min_examined_row_limit=default; | ||
2339 | 45 | |||
2340 | 46 | --source include/rpl_end.inc | ||
2341 | 47 | |||
2342 | 48 | --source include/log_cleanup.inc | ||
2343 | 0 | 49 | ||
2344 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test' | |||
2345 | --- Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test 2012-04-18 23:25:38 +0000 | |||
2346 | +++ Percona-Server/mysql-test/t/percona_log_slow_slave_statements-innodb.test 1970-01-01 00:00:00 +0000 | |||
2347 | @@ -1,42 +0,0 @@ | |||
2348 | 1 | --source include/have_binlog_format_statement.inc | ||
2349 | 2 | --source include/master-slave.inc | ||
2350 | 3 | --source include/have_innodb.inc | ||
2351 | 4 | --let log_file=percona.slow_extended.log_slow_slave_statements-innodb | ||
2352 | 5 | |||
2353 | 6 | connection master; | ||
2354 | 7 | -- disable_warnings | ||
2355 | 8 | DROP TABLE IF EXISTS t; | ||
2356 | 9 | -- enable_warnings | ||
2357 | 10 | |||
2358 | 11 | CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB; | ||
2359 | 12 | INSERT INTO t VALUES | ||
2360 | 13 | (1,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2361 | 14 | (2,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2362 | 15 | (3,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2363 | 16 | (4,"aaaaabbbbbcccccdddddeeeeefffff"), | ||
2364 | 17 | (5,"aaaaabbbbbcccccdddddeeeeefffff"); | ||
2365 | 18 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
2366 | 19 | INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; | ||
2367 | 20 | sync_slave_with_master; | ||
2368 | 21 | |||
2369 | 22 | connection slave; | ||
2370 | 23 | --source include/log_start.inc | ||
2371 | 24 | |||
2372 | 25 | connection master; | ||
2373 | 26 | INSERT INTO t SELECT t.id,t.data from t; | ||
2374 | 27 | sync_slave_with_master; | ||
2375 | 28 | |||
2376 | 29 | connection slave; | ||
2377 | 30 | --source include/log_stop.inc | ||
2378 | 31 | |||
2379 | 32 | --enable_query_log | ||
2380 | 33 | --enable_result_log | ||
2381 | 34 | |||
2382 | 35 | --let grep_pattern = InnoDB_IO_r_ops | ||
2383 | 36 | --source include/log_grep.inc | ||
2384 | 37 | |||
2385 | 38 | connection master; | ||
2386 | 39 | DROP TABLE t; | ||
2387 | 40 | sync_slave_with_master; | ||
2388 | 41 | |||
2389 | 42 | --source include/rpl_end.inc | ||
2390 | 43 | 0 | ||
2391 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_slave_statements-slave.opt' | |||
2392 | --- Percona-Server/mysql-test/t/percona_log_slow_slave_statements-slave.opt 2012-04-18 23:25:38 +0000 | |||
2393 | +++ Percona-Server/mysql-test/t/percona_log_slow_slave_statements-slave.opt 1970-01-01 00:00:00 +0000 | |||
2394 | @@ -1,1 +0,0 @@ | |||
2395 | 1 | --long_query_time=0 | ||
2396 | 2 | \ No newline at end of file | 0 | \ No newline at end of file |
2397 | 3 | 1 | ||
2398 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test' | |||
2399 | --- Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test 1970-01-01 00:00:00 +0000 | |||
2400 | +++ Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test 2013-01-21 06:27:51 +0000 | |||
2401 | @@ -0,0 +1,68 @@ | |||
2402 | 1 | # | ||
2403 | 2 | # Test log_slow_slave_statements | ||
2404 | 3 | # | ||
2405 | 4 | --source include/have_innodb.inc | ||
2406 | 5 | --source include/have_binlog_format_statement.inc | ||
2407 | 6 | --source include/master-slave.inc | ||
2408 | 7 | |||
2409 | 8 | --disable_warnings | ||
2410 | 9 | DROP TABLE IF EXISTS t; | ||
2411 | 10 | --enable_warnings | ||
2412 | 11 | |||
2413 | 12 | CREATE TABLE t(id INT) ENGINE=InnoDB; | ||
2414 | 13 | sync_slave_with_master; | ||
2415 | 14 | |||
2416 | 15 | SET GLOBAL min_examined_row_limit=0; | ||
2417 | 16 | SET GLOBAL long_query_time=0; | ||
2418 | 17 | SET GLOBAL log_slow_slave_statements=OFF; | ||
2419 | 18 | --source include/restart_slave_sql.inc | ||
2420 | 19 | |||
2421 | 20 | --let log_file=percona.slow_extended.log_slow_slave_statements | ||
2422 | 21 | --source include/log_start.inc | ||
2423 | 22 | |||
2424 | 23 | # | ||
2425 | 24 | # A statement that should not be slow-logged | ||
2426 | 25 | # | ||
2427 | 26 | connection master; | ||
2428 | 27 | INSERT INTO t VALUES (1); | ||
2429 | 28 | sync_slave_with_master; | ||
2430 | 29 | |||
2431 | 30 | # | ||
2432 | 31 | # A statement that should be slow-logged | ||
2433 | 32 | # | ||
2434 | 33 | SET GLOBAL log_slow_slave_statements=ON; | ||
2435 | 34 | connection master; | ||
2436 | 35 | # Explicit transaction to avoid slow-logging implicit BEGIN/COMMIT | ||
2437 | 36 | BEGIN; | ||
2438 | 37 | INSERT INTO t VALUES (2); | ||
2439 | 38 | COMMIT; | ||
2440 | 39 | sync_slave_with_master; | ||
2441 | 40 | |||
2442 | 41 | # | ||
2443 | 42 | # A statement that should not be slow-logged | ||
2444 | 43 | # | ||
2445 | 44 | SET GLOBAL log_slow_slave_statements=OFF; | ||
2446 | 45 | connection master; | ||
2447 | 46 | INSERT INTO t VALUES (3); | ||
2448 | 47 | sync_slave_with_master; | ||
2449 | 48 | |||
2450 | 49 | --source include/log_stop.inc | ||
2451 | 50 | |||
2452 | 51 | --let grep_pattern= INSERT INTO t VALUES \(1\) | ||
2453 | 52 | --source include/log_grep.inc | ||
2454 | 53 | --let grep_pattern= INSERT INTO t VALUES \(2\) | ||
2455 | 54 | --source include/log_grep.inc | ||
2456 | 55 | --let grep_pattern= INSERT INTO t VALUES \(3\) | ||
2457 | 56 | --source include/log_grep.inc | ||
2458 | 57 | --let grep_pattern= ^# User@Host: \[SQL_SLAVE\] @ \[\] | ||
2459 | 58 | --source include/log_grep.inc | ||
2460 | 59 | |||
2461 | 60 | connection master; | ||
2462 | 61 | DROP TABLE t; | ||
2463 | 62 | sync_slave_with_master; | ||
2464 | 63 | |||
2465 | 64 | SET GLOBAL log_slow_slave_statements=default; | ||
2466 | 65 | SET GLOBAL long_query_time=default; | ||
2467 | 66 | SET GLOBAL min_examined_row_limit=default; | ||
2468 | 67 | --source include/rpl_end.inc | ||
2469 | 68 | --source include/log_cleanup.inc | ||
2470 | 0 | 69 | ||
2471 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test' | |||
2472 | --- Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test 2012-04-18 23:25:38 +0000 | |||
2473 | +++ Percona-Server/mysql-test/t/percona_log_slow_slave_statements.test 1970-01-01 00:00:00 +0000 | |||
2474 | @@ -1,117 +0,0 @@ | |||
2475 | 1 | -- source include/have_binlog_format_statement.inc | ||
2476 | 2 | -- source include/master-slave.inc | ||
2477 | 3 | --let log_file=percona.slow_extended.log_slow_slave_statements | ||
2478 | 4 | --let show=SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'log_slow_slave_statements'; | ||
2479 | 5 | |||
2480 | 6 | connection master; | ||
2481 | 7 | -- disable_warnings | ||
2482 | 8 | DROP TABLE IF EXISTS t; | ||
2483 | 9 | -- enable_warnings | ||
2484 | 10 | |||
2485 | 11 | CREATE TABLE t(id INT); | ||
2486 | 12 | sync_slave_with_master; | ||
2487 | 13 | |||
2488 | 14 | connection slave; | ||
2489 | 15 | --source include/log_start.inc | ||
2490 | 16 | |||
2491 | 17 | --disable_query_log | ||
2492 | 18 | --disable_result_log | ||
2493 | 19 | |||
2494 | 20 | --echo LINE 1 | ||
2495 | 21 | connection master; | ||
2496 | 22 | INSERT INTO t VALUES (1); | ||
2497 | 23 | sync_slave_with_master; | ||
2498 | 24 | |||
2499 | 25 | connection slave; | ||
2500 | 26 | --let value=`$show` | ||
2501 | 27 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2502 | 28 | --echo LOG_SLOW_SLAVE_STATEMENTS=ON | ||
2503 | 29 | SET GLOBAL log_slow_slave_statements=ON; | ||
2504 | 30 | --let value=`$show` | ||
2505 | 31 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2506 | 32 | |||
2507 | 33 | --echo LINE 2 | ||
2508 | 34 | connection master; | ||
2509 | 35 | INSERT INTO t VALUES (2); | ||
2510 | 36 | sync_slave_with_master; | ||
2511 | 37 | |||
2512 | 38 | --source include/restart_slave_sql.inc | ||
2513 | 39 | |||
2514 | 40 | connection slave; | ||
2515 | 41 | --let value=`$show` | ||
2516 | 42 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2517 | 43 | |||
2518 | 44 | --echo LINE 3 | ||
2519 | 45 | connection master; | ||
2520 | 46 | INSERT INTO t VALUES (3); | ||
2521 | 47 | sync_slave_with_master; | ||
2522 | 48 | |||
2523 | 49 | connection slave; | ||
2524 | 50 | --let value=`$show` | ||
2525 | 51 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2526 | 52 | --echo LOG_SLOW_SLAVE_STATEMENTS=OFF | ||
2527 | 53 | SET GLOBAL log_slow_slave_statements=OFF; | ||
2528 | 54 | --let value=`$show` | ||
2529 | 55 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2530 | 56 | |||
2531 | 57 | --echo LINE 4 | ||
2532 | 58 | connection master; | ||
2533 | 59 | INSERT INTO t VALUES (4); | ||
2534 | 60 | sync_slave_with_master; | ||
2535 | 61 | |||
2536 | 62 | --source include/restart_slave_sql.inc | ||
2537 | 63 | |||
2538 | 64 | connection slave; | ||
2539 | 65 | --let value=`$show` | ||
2540 | 66 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2541 | 67 | |||
2542 | 68 | --echo LINE 5 | ||
2543 | 69 | connection master; | ||
2544 | 70 | INSERT INTO t VALUES (5); | ||
2545 | 71 | sync_slave_with_master; | ||
2546 | 72 | |||
2547 | 73 | connection slave; | ||
2548 | 74 | --let value=`$show` | ||
2549 | 75 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2550 | 76 | --echo LOG_SLOW_SLAVE_STATEMENTS=ON | ||
2551 | 77 | SET GLOBAL log_slow_slave_statements=ON; | ||
2552 | 78 | --let value=`$show` | ||
2553 | 79 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2554 | 80 | |||
2555 | 81 | --echo LINE 6 | ||
2556 | 82 | connection master; | ||
2557 | 83 | INSERT INTO t VALUES (6); | ||
2558 | 84 | sync_slave_with_master; | ||
2559 | 85 | |||
2560 | 86 | --source include/restart_slave_sql.inc | ||
2561 | 87 | |||
2562 | 88 | connection slave; | ||
2563 | 89 | --let value=`$show` | ||
2564 | 90 | --echo LOG_SLOW_SLAVE_STATAMENTS is $value | ||
2565 | 91 | |||
2566 | 92 | --echo LINE 7 | ||
2567 | 93 | connection master; | ||
2568 | 94 | INSERT INTO t VALUES (7); | ||
2569 | 95 | sync_slave_with_master; | ||
2570 | 96 | |||
2571 | 97 | --enable_query_log | ||
2572 | 98 | --enable_result_log | ||
2573 | 99 | |||
2574 | 100 | connection slave; | ||
2575 | 101 | --source include/log_stop.inc | ||
2576 | 102 | SET GLOBAL log_slow_slave_statements=default; | ||
2577 | 103 | |||
2578 | 104 | connection slave; | ||
2579 | 105 | --let i=1 | ||
2580 | 106 | while($i < 8) | ||
2581 | 107 | { | ||
2582 | 108 | --let grep_pattern= INSERT INTO t VALUES \($i\) | ||
2583 | 109 | --source include/log_grep.inc | ||
2584 | 110 | inc $i; | ||
2585 | 111 | } | ||
2586 | 112 | |||
2587 | 113 | connection master; | ||
2588 | 114 | DROP TABLE t; | ||
2589 | 115 | sync_slave_with_master; | ||
2590 | 116 | |||
2591 | 117 | --source include/rpl_end.inc | ||
2592 | 118 | 0 | ||
2593 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test' | |||
2594 | --- Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test 1970-01-01 00:00:00 +0000 | |||
2595 | +++ Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test 2013-01-21 06:27:51 +0000 | |||
2596 | @@ -0,0 +1,41 @@ | |||
2597 | 1 | # | ||
2598 | 2 | # Test slow-logging of statements in stored procedures | ||
2599 | 3 | # | ||
2600 | 4 | --disable_warnings | ||
2601 | 5 | DROP PROCEDURE IF EXISTS test_f; | ||
2602 | 6 | --enable_warnings | ||
2603 | 7 | |||
2604 | 8 | SET SESSION min_examined_row_limit=0; | ||
2605 | 9 | SET SESSION long_query_time=0; | ||
2606 | 10 | SET SESSION query_cache_type=0; | ||
2607 | 11 | |||
2608 | 12 | delimiter ^; | ||
2609 | 13 | CREATE PROCEDURE test_f() | ||
2610 | 14 | BEGIN | ||
2611 | 15 | SELECT 1; | ||
2612 | 16 | END^ | ||
2613 | 17 | delimiter ;^ | ||
2614 | 18 | |||
2615 | 19 | SET GLOBAL log_slow_sp_statements=ON; | ||
2616 | 20 | --let log_file=percona.slow_extended.sp1 | ||
2617 | 21 | --source include/log_start.inc | ||
2618 | 22 | CALL test_f(); | ||
2619 | 23 | --source include/log_stop.inc | ||
2620 | 24 | --let grep_pattern=SELECT 1; | ||
2621 | 25 | --source include/log_grep.inc | ||
2622 | 26 | |||
2623 | 27 | SET GLOBAL log_slow_sp_statements=OFF; | ||
2624 | 28 | --let log_file=percona.slow_extended.sp2 | ||
2625 | 29 | --source include/log_start.inc | ||
2626 | 30 | CALL test_f(); | ||
2627 | 31 | --source include/log_stop.inc | ||
2628 | 32 | --let grep_pattern=SELECT 1; | ||
2629 | 33 | --source include/log_grep.inc | ||
2630 | 34 | |||
2631 | 35 | DROP PROCEDURE test_f; | ||
2632 | 36 | |||
2633 | 37 | SET GLOBAL log_slow_sp_statements=default; | ||
2634 | 38 | SET SESSION long_query_time=default; | ||
2635 | 39 | SET SESSION min_examined_row_limit=default; | ||
2636 | 40 | SET SESSION query_cache_type=default; | ||
2637 | 41 | --source include/log_cleanup.inc | ||
2638 | 0 | 42 | ||
2639 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test' | |||
2640 | --- Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test 2012-04-18 23:25:38 +0000 | |||
2641 | +++ Percona-Server/mysql-test/t/percona_log_slow_sp_statements.test 1970-01-01 00:00:00 +0000 | |||
2642 | @@ -1,29 +0,0 @@ | |||
2643 | 1 | --source include/have_debug.inc | ||
2644 | 2 | |||
2645 | 3 | SET long_query_time=1; | ||
2646 | 4 | SET GLOBAL log_slow_sp_statements=ON; | ||
2647 | 5 | SET SESSION query_exec_time=0.1; | ||
2648 | 6 | --let log_file=percona.slow_extended.log_slow_sp_statements | ||
2649 | 7 | --source include/log_start.inc | ||
2650 | 8 | |||
2651 | 9 | delimiter ^; | ||
2652 | 10 | CREATE PROCEDURE test_f() | ||
2653 | 11 | BEGIN | ||
2654 | 12 | SET SESSION query_exec_time=1.1; SELECT 1; | ||
2655 | 13 | SET SESSION query_exec_time=2.1; SELECT 1; | ||
2656 | 14 | SET SESSION query_exec_time=3.1; SELECT 1; | ||
2657 | 15 | SET SESSION query_exec_time=0.1; | ||
2658 | 16 | END^ | ||
2659 | 17 | delimiter ;^ | ||
2660 | 18 | |||
2661 | 19 | CALL test_f(); | ||
2662 | 20 | |||
2663 | 21 | --source include/log_stop.inc | ||
2664 | 22 | SET SESSION query_exec_time=default; | ||
2665 | 23 | SET GLOBAL log_slow_sp_statements=default; | ||
2666 | 24 | SET long_query_time=default; | ||
2667 | 25 | |||
2668 | 26 | --let grep_pattern = Query_time | ||
2669 | 27 | --source include/log_grep.inc | ||
2670 | 28 | |||
2671 | 29 | DROP PROCEDURE test_f; | ||
2672 | 30 | 0 | ||
2673 | === added file 'Percona-Server/mysql-test/t/percona_log_slow_verbosity.test' | |||
2674 | --- Percona-Server/mysql-test/t/percona_log_slow_verbosity.test 1970-01-01 00:00:00 +0000 | |||
2675 | +++ Percona-Server/mysql-test/t/percona_log_slow_verbosity.test 2013-01-21 06:27:51 +0000 | |||
2676 | @@ -0,0 +1,75 @@ | |||
2677 | 1 | # | ||
2678 | 2 | # Test the extended slow query log output format for various log_slow_verbosity values. | ||
2679 | 3 | # | ||
2680 | 4 | --source include/have_innodb.inc | ||
2681 | 5 | |||
2682 | 6 | --disable_warnings | ||
2683 | 7 | DROP TABLE IF EXISTS t1; | ||
2684 | 8 | --enable_warnings | ||
2685 | 9 | |||
2686 | 10 | CREATE TABLE t1(a INT) ENGINE=InnoDB; | ||
2687 | 11 | |||
2688 | 12 | SET SESSION min_examined_row_limit=0; | ||
2689 | 13 | SET SESSION long_query_time=0; | ||
2690 | 14 | |||
2691 | 15 | # | ||
2692 | 16 | # Test all enabled options with InnoDB-involving query | ||
2693 | 17 | # | ||
2694 | 18 | SET SESSION log_slow_verbosity='microtime,innodb,query_plan'; | ||
2695 | 19 | --let log_file=percona.slow_extended.log_slow_verbosity_0 | ||
2696 | 20 | |||
2697 | 21 | --source include/log_start.inc | ||
2698 | 22 | INSERT INTO t1 VALUE(0); | ||
2699 | 23 | --source include/log_stop.inc | ||
2700 | 24 | |||
2701 | 25 | --echo log_slow_verbosity='microtime,innodb,query_plan': | ||
2702 | 26 | --source include/percona_slow_log_verbosity_grep.inc | ||
2703 | 27 | |||
2704 | 28 | # | ||
2705 | 29 | # Test for "No InnoDB statistics available" in output when InnoDB stats are requested | ||
2706 | 30 | # but the query does not involve InnoDB tables | ||
2707 | 31 | # | ||
2708 | 32 | |||
2709 | 33 | SET SESSION log_slow_verbosity='microtime,innodb,query_plan'; | ||
2710 | 34 | --let log_file=percona.slow_extended.log_slow_verbosity_1 | ||
2711 | 35 | |||
2712 | 36 | --source include/log_start.inc | ||
2713 | 37 | SELECT 1; | ||
2714 | 38 | --source include/log_stop.inc | ||
2715 | 39 | |||
2716 | 40 | --echo log_slow_verbosity='microtime,innodb,query_plan': | ||
2717 | 41 | --source include/percona_slow_log_verbosity_grep.inc | ||
2718 | 42 | |||
2719 | 43 | # | ||
2720 | 44 | # Test only 'microtime' in the output (bug 730173: InnoDB and query plan information | ||
2721 | 45 | # are logged when not enabled) | ||
2722 | 46 | # | ||
2723 | 47 | SET log_slow_verbosity='microtime'; | ||
2724 | 48 | --let log_file=percona.slow_extended.log_slow_verbosity_2 | ||
2725 | 49 | |||
2726 | 50 | --source include/log_start.inc | ||
2727 | 51 | INSERT INTO t1 VALUE(1); | ||
2728 | 52 | --source include/log_stop.inc | ||
2729 | 53 | |||
2730 | 54 | --echo log_slow_verbosity='microtime': | ||
2731 | 55 | --source include/percona_slow_log_verbosity_grep.inc | ||
2732 | 56 | |||
2733 | 57 | # | ||
2734 | 58 | # Test 'query_plan' | ||
2735 | 59 | # | ||
2736 | 60 | SET log_slow_verbosity='microtime,query_plan'; | ||
2737 | 61 | --let log_file=percona.slow_extended.log_slow_verbosity_3 | ||
2738 | 62 | |||
2739 | 63 | --source include/log_start.inc | ||
2740 | 64 | INSERT INTO t1 VALUE(2); | ||
2741 | 65 | --source include/log_stop.inc | ||
2742 | 66 | |||
2743 | 67 | --echo log_slow_verbosity='query_plan': | ||
2744 | 68 | --source include/percona_slow_log_verbosity_grep.inc | ||
2745 | 69 | |||
2746 | 70 | SET SESSION log_slow_verbosity=default; | ||
2747 | 71 | SET SESSION long_query_time=default; | ||
2748 | 72 | SET SESSION min_examined_row_limit=default; | ||
2749 | 73 | |||
2750 | 74 | DROP TABLE t1; | ||
2751 | 75 | --source include/log_cleanup.inc | ||
2752 | 0 | 76 | ||
2753 | === removed file 'Percona-Server/mysql-test/t/percona_log_slow_verbosity.test' | |||
2754 | --- Percona-Server/mysql-test/t/percona_log_slow_verbosity.test 2012-04-18 23:25:38 +0000 | |||
2755 | +++ Percona-Server/mysql-test/t/percona_log_slow_verbosity.test 1970-01-01 00:00:00 +0000 | |||
2756 | @@ -1,19 +0,0 @@ | |||
2757 | 1 | --source include/have_innodb.inc | ||
2758 | 2 | --source include/have_debug.inc | ||
2759 | 3 | |||
2760 | 4 | SET SESSION long_query_time=1; | ||
2761 | 5 | --let log_file=percona.slow_extended.log_slow_verbosity | ||
2762 | 6 | --source include/log_start.inc | ||
2763 | 7 | |||
2764 | 8 | SET SESSION query_exec_time=2.1; | ||
2765 | 9 | SELECT 1; | ||
2766 | 10 | SET SESSION log_slow_verbosity=innodb; | ||
2767 | 11 | SELECT 1; | ||
2768 | 12 | SET SESSION query_exec_time=default; | ||
2769 | 13 | |||
2770 | 14 | --source include/log_stop.inc | ||
2771 | 15 | SET log_slow_verbosity=default; | ||
2772 | 16 | SET long_query_time=default; | ||
2773 | 17 | |||
2774 | 18 | --let grep_pattern = No InnoDB statistics available for this query | ||
2775 | 19 | --source include/log_grep.inc | ||
2776 | 20 | 0 | ||
2777 | === added file 'Percona-Server/mysql-test/t/percona_long_query_time.test' | |||
2778 | --- Percona-Server/mysql-test/t/percona_long_query_time.test 1970-01-01 00:00:00 +0000 | |||
2779 | +++ Percona-Server/mysql-test/t/percona_long_query_time.test 2013-01-21 06:27:51 +0000 | |||
2780 | @@ -0,0 +1,29 @@ | |||
2781 | 1 | --source include/have_debug.inc | ||
2782 | 2 | |||
2783 | 3 | SET SESSION min_examined_row_limit=0; | ||
2784 | 4 | SET long_query_time=2; | ||
2785 | 5 | --let log_file=percona.slow_extended.long_query_time | ||
2786 | 6 | --source include/log_start.inc | ||
2787 | 7 | |||
2788 | 8 | SET SESSION query_exec_time=1.1; SELECT 1; | ||
2789 | 9 | SET SESSION query_exec_time=3.1; SELECT 1; | ||
2790 | 10 | SET SESSION query_exec_time=5.1; SELECT 1; | ||
2791 | 11 | |||
2792 | 12 | SET long_query_time=4; | ||
2793 | 13 | |||
2794 | 14 | SET SESSION query_exec_time=1.1; SELECT 1; | ||
2795 | 15 | SET SESSION query_exec_time=3.1; SELECT 1; | ||
2796 | 16 | SET SESSION query_exec_time=5.1; SELECT 1; | ||
2797 | 17 | |||
2798 | 18 | SET SESSION query_exec_time=default; | ||
2799 | 19 | |||
2800 | 20 | SET long_query_time=2; | ||
2801 | 21 | |||
2802 | 22 | --source include/log_stop.inc | ||
2803 | 23 | SET long_query_time=default; | ||
2804 | 24 | SET SESSION min_examined_row_limit=default; | ||
2805 | 25 | |||
2806 | 26 | --let grep_pattern = Query_time | ||
2807 | 27 | --source include/log_grep.inc | ||
2808 | 28 | |||
2809 | 29 | --source include/log_cleanup.inc | ||
2810 | 0 | 30 | ||
2811 | === removed file 'Percona-Server/mysql-test/t/percona_long_query_time.test' | |||
2812 | --- Percona-Server/mysql-test/t/percona_long_query_time.test 2012-04-18 23:25:38 +0000 | |||
2813 | +++ Percona-Server/mysql-test/t/percona_long_query_time.test 1970-01-01 00:00:00 +0000 | |||
2814 | @@ -1,25 +0,0 @@ | |||
2815 | 1 | --source include/have_debug.inc | ||
2816 | 2 | |||
2817 | 3 | SET long_query_time=2; | ||
2818 | 4 | --let log_file=percona.slow_extended.long_query_time | ||
2819 | 5 | --source include/log_start.inc | ||
2820 | 6 | |||
2821 | 7 | SET SESSION query_exec_time=1.1; SELECT 1; | ||
2822 | 8 | SET SESSION query_exec_time=3.1; SELECT 1; | ||
2823 | 9 | SET SESSION query_exec_time=5.1; SELECT 1; | ||
2824 | 10 | |||
2825 | 11 | SET long_query_time=4; | ||
2826 | 12 | |||
2827 | 13 | SET SESSION query_exec_time=1.1; SELECT 1; | ||
2828 | 14 | SET SESSION query_exec_time=3.1; SELECT 1; | ||
2829 | 15 | SET SESSION query_exec_time=5.1; SELECT 1; | ||
2830 | 16 | |||
2831 | 17 | SET SESSION query_exec_time=default; | ||
2832 | 18 | |||
2833 | 19 | SET long_query_time=2; | ||
2834 | 20 | |||
2835 | 21 | --source include/log_stop.inc | ||
2836 | 22 | SET long_query_time=default; | ||
2837 | 23 | |||
2838 | 24 | --let grep_pattern = Query_time | ||
2839 | 25 | --source include/log_grep.inc | ||
2840 | 26 | 0 | ||
2841 | === added file 'Percona-Server/mysql-test/t/percona_min_examined_row_limit.test' | |||
2842 | --- Percona-Server/mysql-test/t/percona_min_examined_row_limit.test 1970-01-01 00:00:00 +0000 | |||
2843 | +++ Percona-Server/mysql-test/t/percona_min_examined_row_limit.test 2013-01-21 06:27:51 +0000 | |||
2844 | @@ -0,0 +1,36 @@ | |||
2845 | 1 | --source include/have_debug.inc | ||
2846 | 2 | |||
2847 | 3 | --disable_warnings | ||
2848 | 4 | drop table if exists t; | ||
2849 | 5 | --enable_warnings | ||
2850 | 6 | |||
2851 | 7 | create table t(id INT PRIMARY KEY); | ||
2852 | 8 | insert into t values(1); | ||
2853 | 9 | insert into t values(2); | ||
2854 | 10 | insert into t values(3); | ||
2855 | 11 | |||
2856 | 12 | SET GLOBAL long_query_time=2; | ||
2857 | 13 | SET GLOBAL slow_query_log_use_global_control='long_query_time,min_examined_row_limit'; | ||
2858 | 14 | --let log_file=percona.slow_extended.min_examined_row_limit | ||
2859 | 15 | --source include/log_start.inc | ||
2860 | 16 | |||
2861 | 17 | SET SESSION query_exec_time=2.1; | ||
2862 | 18 | SELECT 1; | ||
2863 | 19 | |||
2864 | 20 | SET GLOBAL min_examined_row_limit=5; | ||
2865 | 21 | |||
2866 | 22 | SELECT * FROM t AS t1, t AS t2; | ||
2867 | 23 | SELECT 1; | ||
2868 | 24 | |||
2869 | 25 | SET SESSION query_exec_time=default; | ||
2870 | 26 | |||
2871 | 27 | --source include/log_stop.inc | ||
2872 | 28 | SET GLOBAL min_examined_row_limit=default; | ||
2873 | 29 | SET GLOBAL slow_query_log_use_global_control=default; | ||
2874 | 30 | SET GLOBAL long_query_time=default; | ||
2875 | 31 | |||
2876 | 32 | --let grep_pattern = Query_time | ||
2877 | 33 | --source include/log_grep.inc | ||
2878 | 34 | |||
2879 | 35 | DROP TABLE t; | ||
2880 | 36 | --source include/log_cleanup.inc | ||
2881 | 0 | 37 | ||
2882 | === removed file 'Percona-Server/mysql-test/t/percona_min_examined_row_limit.test' | |||
2883 | --- Percona-Server/mysql-test/t/percona_min_examined_row_limit.test 2012-04-18 23:25:38 +0000 | |||
2884 | +++ Percona-Server/mysql-test/t/percona_min_examined_row_limit.test 1970-01-01 00:00:00 +0000 | |||
2885 | @@ -1,35 +0,0 @@ | |||
2886 | 1 | --source include/have_debug.inc | ||
2887 | 2 | |||
2888 | 3 | --disable_warnings | ||
2889 | 4 | drop table if exists t; | ||
2890 | 5 | --enable_warnings | ||
2891 | 6 | |||
2892 | 7 | create table t(id INT PRIMARY KEY); | ||
2893 | 8 | insert into t values(1); | ||
2894 | 9 | insert into t values(2); | ||
2895 | 10 | insert into t values(3); | ||
2896 | 11 | |||
2897 | 12 | SET GLOBAL long_query_time=2; | ||
2898 | 13 | SET GLOBAL slow_query_log_use_global_control='long_query_time,min_examined_row_limit'; | ||
2899 | 14 | --let log_file=percona.slow_extended.min_examined_row_limit | ||
2900 | 15 | --source include/log_start.inc | ||
2901 | 16 | |||
2902 | 17 | SET SESSION query_exec_time=2.1; | ||
2903 | 18 | SELECT 1; | ||
2904 | 19 | |||
2905 | 20 | SET GLOBAL min_examined_row_limit=5; | ||
2906 | 21 | |||
2907 | 22 | select * from t as t1, t as t2; | ||
2908 | 23 | SELECT 1; | ||
2909 | 24 | |||
2910 | 25 | SET SESSION query_exec_time=default; | ||
2911 | 26 | |||
2912 | 27 | --source include/log_stop.inc | ||
2913 | 28 | SET GLOBAL min_examined_row_limit=default; | ||
2914 | 29 | SET GLOBAL slow_query_log_use_global_control=default; | ||
2915 | 30 | SET GLOBAL long_query_time=default; | ||
2916 | 31 | |||
2917 | 32 | --let grep_pattern = Query_time | ||
2918 | 33 | --source include/log_grep.inc | ||
2919 | 34 | |||
2920 | 35 | DROP TABLE t; | ||
2921 | 36 | 0 | ||
2922 | === added file 'Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test' | |||
2923 | --- Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test 1970-01-01 00:00:00 +0000 | |||
2924 | +++ Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test 2013-01-21 06:27:51 +0000 | |||
2925 | @@ -0,0 +1,71 @@ | |||
2926 | 1 | # Current test checks Last_errno for administrative command "Quit" | ||
2927 | 2 | # See Launchpad Bug #716210 | ||
2928 | 3 | |||
2929 | 4 | --source include/have_innodb.inc | ||
2930 | 5 | --source include/count_sessions.inc | ||
2931 | 6 | |||
2932 | 7 | --disable_warnings | ||
2933 | 8 | DROP TABLE IF EXISTS t; | ||
2934 | 9 | --enable_warnings | ||
2935 | 10 | |||
2936 | 11 | SET GLOBAL log_slow_admin_statements=ON; | ||
2937 | 12 | SET GLOBAL long_query_time=0; | ||
2938 | 13 | SET GLOBAL min_examined_row_limit=0; | ||
2939 | 14 | |||
2940 | 15 | CREATE TABLE t(a INT) engine=InnoDB; | ||
2941 | 16 | |||
2942 | 17 | --connect(additional,localhost,root,,) | ||
2943 | 18 | --connection additional | ||
2944 | 19 | |||
2945 | 20 | # | ||
2946 | 21 | # 1st command in the log that sets Last_errno | ||
2947 | 22 | # | ||
2948 | 23 | --let log_file=percona.slow_extended.error_on_quit_1 | ||
2949 | 24 | --source include/log_start.inc | ||
2950 | 25 | |||
2951 | 26 | --error ER_TABLE_EXISTS_ERROR | ||
2952 | 27 | CREATE TABLE t(a INT) engine=InnoDB; | ||
2953 | 28 | --source include/log_stop.inc | ||
2954 | 29 | |||
2955 | 30 | --let grep_pattern=Last_errno: [1-9]\d*\s | ||
2956 | 31 | --source include/log_grep.inc | ||
2957 | 32 | |||
2958 | 33 | # | ||
2959 | 34 | # Subsequent Quit should not have Last_errno set | ||
2960 | 35 | # | ||
2961 | 36 | --let log_file=percona.slow_extended.error_on_quit_2 | ||
2962 | 37 | --source include/log_start.inc | ||
2963 | 38 | --echo # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | ||
2964 | 39 | --disconnect additional | ||
2965 | 40 | --connection default | ||
2966 | 41 | --source include/wait_until_count_sessions.inc | ||
2967 | 42 | --source include/log_stop.inc | ||
2968 | 43 | |||
2969 | 44 | --let grep_pattern=Last_errno: 0\s | ||
2970 | 45 | --source include/log_grep.inc | ||
2971 | 46 | |||
2972 | 47 | --connect(additional,localhost,root,,) | ||
2973 | 48 | --connection additional | ||
2974 | 49 | |||
2975 | 50 | # | ||
2976 | 51 | # Negative case: both regular command and Quit with errno = 0 | ||
2977 | 52 | # | ||
2978 | 53 | --let log_file=percona.slow_extended.error_on_quit_3 | ||
2979 | 54 | --source include/log_start.inc | ||
2980 | 55 | |||
2981 | 56 | SELECT * FROM t; | ||
2982 | 57 | |||
2983 | 58 | --echo # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | ||
2984 | 59 | --disconnect additional | ||
2985 | 60 | --connection default | ||
2986 | 61 | --source include/wait_until_count_sessions.inc | ||
2987 | 62 | --source include/log_stop.inc | ||
2988 | 63 | |||
2989 | 64 | --let grep_pattern= Last_errno: 0\s | ||
2990 | 65 | --source include/log_grep.inc | ||
2991 | 66 | |||
2992 | 67 | DROP TABLE t; | ||
2993 | 68 | SET GLOBAL log_slow_admin_statements=default; | ||
2994 | 69 | SET GLOBAL long_query_time=default; | ||
2995 | 70 | SET GLOBAL min_examined_row_limit=default; | ||
2996 | 71 | --source include/log_cleanup.inc | ||
2997 | 0 | 72 | ||
2998 | === removed file 'Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test' | |||
2999 | --- Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test 2012-10-27 05:16:07 +0000 | |||
3000 | +++ Percona-Server/mysql-test/t/percona_slow_extended_error_on_quit.test 1970-01-01 00:00:00 +0000 | |||
3001 | @@ -1,87 +0,0 @@ | |||
3002 | 1 | ################################################################################ | ||
3003 | 2 | # Current test check following attributes: # | ||
3004 | 3 | # 1) "Last_errno" # | ||
3005 | 4 | # 2) "Rows_{sent,examined|affected|read} # | ||
3006 | 5 | # 3) Bytes_sent # | ||
3007 | 6 | # 4) Tmp_{tables|dist_tables|table_size} # | ||
3008 | 7 | # 5) InnoDB statistic counters # | ||
3009 | 8 | # in Slow Query Log # | ||
3010 | 9 | # for administrative command "Quit" # | ||
3011 | 10 | # # | ||
3012 | 11 | # See Launchpad Bug #716210 # | ||
3013 | 12 | ################################################################################ | ||
3014 | 13 | |||
3015 | 14 | --source include/have_innodb.inc | ||
3016 | 15 | |||
3017 | 16 | ################################################################################ | ||
3018 | 17 | --let log_file=percona.slow_extended.error_on_quit | ||
3019 | 18 | --let wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST; | ||
3020 | 19 | ################################################################################ | ||
3021 | 20 | |||
3022 | 21 | --disable_warnings | ||
3023 | 22 | DROP TABLE IF EXISTS t; | ||
3024 | 23 | --enable_warnings | ||
3025 | 24 | CREATE TABLE t(a INT) engine=InnoDB; | ||
3026 | 25 | INSERT INTO t VALUES(0),(1),(2),(3),(4); | ||
3027 | 26 | |||
3028 | 27 | ################################################################################ | ||
3029 | 28 | --source include/log_start.inc | ||
3030 | 29 | |||
3031 | 30 | --connect(additional,localhost,root,,) | ||
3032 | 31 | --connection additional | ||
3033 | 32 | |||
3034 | 33 | SET log_slow_verbosity=innodb; | ||
3035 | 34 | SET long_query_time= 0; | ||
3036 | 35 | |||
3037 | 36 | --disable_result_log | ||
3038 | 37 | --error ER_TABLE_EXISTS_ERROR | ||
3039 | 38 | CREATE TABLE t(a INT) engine=InnoDB; | ||
3040 | 39 | --enable_result_log | ||
3041 | 40 | |||
3042 | 41 | --connection default | ||
3043 | 42 | --echo # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | ||
3044 | 43 | --disconnect additional | ||
3045 | 44 | --source include/wait_condition.inc | ||
3046 | 45 | --source include/log_stop.inc | ||
3047 | 46 | --source include/percona_slow_extended_error_on_quit.inc | ||
3048 | 47 | ################################################################################ | ||
3049 | 48 | --source include/log_start.inc | ||
3050 | 49 | |||
3051 | 50 | --connect(additional,localhost,root,,) | ||
3052 | 51 | --connection additional | ||
3053 | 52 | |||
3054 | 53 | SET log_slow_verbosity=innodb; | ||
3055 | 54 | SET long_query_time= 0; | ||
3056 | 55 | |||
3057 | 56 | --disable_result_log | ||
3058 | 57 | INSERT INTO t SELECT * FROM t ORDER BY RAND(); | ||
3059 | 58 | --enable_result_log | ||
3060 | 59 | |||
3061 | 60 | --connection default | ||
3062 | 61 | --echo # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | ||
3063 | 62 | --disconnect additional | ||
3064 | 63 | --source include/wait_condition.inc | ||
3065 | 64 | --source include/log_stop.inc | ||
3066 | 65 | --source include/percona_slow_extended_error_on_quit.inc | ||
3067 | 66 | ################################################################################ | ||
3068 | 67 | --source include/log_start.inc | ||
3069 | 68 | |||
3070 | 69 | --connect(additional,localhost,root,,) | ||
3071 | 70 | --connection additional | ||
3072 | 71 | |||
3073 | 72 | SET log_slow_verbosity=innodb; | ||
3074 | 73 | SET long_query_time= 0; | ||
3075 | 74 | |||
3076 | 75 | --disable_result_log | ||
3077 | 76 | SELECT * FROM t; | ||
3078 | 77 | --enable_result_log | ||
3079 | 78 | |||
3080 | 79 | --connection default | ||
3081 | 80 | --echo # Disconnecting (passing to Slow Query Log "# administrative command: Quit") | ||
3082 | 81 | --disconnect additional | ||
3083 | 82 | --source include/wait_condition.inc | ||
3084 | 83 | --source include/log_stop.inc | ||
3085 | 84 | --source include/percona_slow_extended_error_on_quit.inc | ||
3086 | 85 | ################################################################################ | ||
3087 | 86 | |||
3088 | 87 | DROP TABLE t; | ||
3089 | 88 | 0 | ||
3090 | === added file 'Percona-Server/mysql-test/t/percona_slow_extended_log_error.test' | |||
3091 | --- Percona-Server/mysql-test/t/percona_slow_extended_log_error.test 1970-01-01 00:00:00 +0000 | |||
3092 | +++ Percona-Server/mysql-test/t/percona_slow_extended_log_error.test 2013-01-21 06:27:51 +0000 | |||
3093 | @@ -0,0 +1,31 @@ | |||
3094 | 1 | # | ||
3095 | 2 | # Test last_errno in extended slow query log | ||
3096 | 3 | # | ||
3097 | 4 | |||
3098 | 5 | --disable_warnings | ||
3099 | 6 | DROP TABLE IF EXISTS t1; | ||
3100 | 7 | --enable_warnings | ||
3101 | 8 | |||
3102 | 9 | SET SESSION min_examined_row_limit=0; | ||
3103 | 10 | SET long_query_time=0; | ||
3104 | 11 | |||
3105 | 12 | --let log_file=percona.slow_extended.log_error_1 | ||
3106 | 13 | --source include/log_start.inc | ||
3107 | 14 | CREATE TABLE t1(a INT); | ||
3108 | 15 | --source include/log_stop.inc | ||
3109 | 16 | --let grep_pattern = ^.*Last_errno: 0 .*\$ | ||
3110 | 17 | --source include/log_grep.inc | ||
3111 | 18 | |||
3112 | 19 | --let log_file=percona.slow_extended.log_error_2 | ||
3113 | 20 | --source include/log_start.inc | ||
3114 | 21 | --error ER_TABLE_EXISTS_ERROR | ||
3115 | 22 | CREATE TABLE t1(a INT); | ||
3116 | 23 | --source include/log_stop.inc | ||
3117 | 24 | --let grep_pattern = ^.*Last_errno: 1050 .*\$ | ||
3118 | 25 | --source include/log_grep.inc | ||
3119 | 26 | |||
3120 | 27 | DROP TABLE t1; | ||
3121 | 28 | |||
3122 | 29 | SET long_query_time=default; | ||
3123 | 30 | SET SESSION min_examined_row_limit=default; | ||
3124 | 31 | --source include/log_cleanup.inc | ||
3125 | 0 | 32 | ||
3126 | === removed file 'Percona-Server/mysql-test/t/percona_slow_extended_log_error.test' | |||
3127 | --- Percona-Server/mysql-test/t/percona_slow_extended_log_error.test 2012-04-18 23:25:38 +0000 | |||
3128 | +++ Percona-Server/mysql-test/t/percona_slow_extended_log_error.test 1970-01-01 00:00:00 +0000 | |||
3129 | @@ -1,15 +0,0 @@ | |||
3130 | 1 | --let log_file=percona.slow_extended.log_error | ||
3131 | 2 | SET long_query_time=0; | ||
3132 | 3 | --disable_warnings | ||
3133 | 4 | DROP TABLE IF EXISTS t1; | ||
3134 | 5 | --enable_warnings | ||
3135 | 6 | CREATE TABLE t(a INT); | ||
3136 | 7 | --source include/log_start.inc | ||
3137 | 8 | |||
3138 | 9 | --error ER_TABLE_EXISTS_ERROR | ||
3139 | 10 | CREATE TABLE t(a INT); | ||
3140 | 11 | |||
3141 | 12 | --source include/log_stop.inc | ||
3142 | 13 | --let grep_pattern = Last_errno: 1050 | ||
3143 | 14 | --source include/log_grep.inc | ||
3144 | 15 | DROP TABLE t; | ||
3145 | 16 | 0 | ||
3146 | === modified file 'Percona-Server/mysql-test/t/percona_slow_query_log_rate.test' | |||
3147 | --- Percona-Server/mysql-test/t/percona_slow_query_log_rate.test 2012-04-18 23:25:38 +0000 | |||
3148 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_rate.test 2013-01-21 06:27:51 +0000 | |||
3149 | @@ -1,16 +1,23 @@ | |||
3152 | 1 | --source include/have_debug.inc | 1 | # Force deterministic session and query ids |
3153 | 2 | --let log_file=percona.slow_extended.log_slow_rate_limit | 2 | --source include/restart_mysqld.inc |
3154 | 3 | 3 | ||
3156 | 4 | SET GLOBAL long_query_time=1; | 4 | SET GLOBAL long_query_time=0; |
3157 | 5 | 5 | ||
3158 | 6 | SET GLOBAL log_slow_rate_type='session'; | 6 | SET GLOBAL log_slow_rate_type='session'; |
3159 | 7 | SET GLOBAL log_slow_rate_limit=3; | 7 | SET GLOBAL log_slow_rate_limit=3; |
3160 | 8 | --let log_file=percona.slow_extended.log_slow_rate_limit_1 | ||
3161 | 8 | --source include/percona_slow_query_log_rate.inc | 9 | --source include/percona_slow_query_log_rate.inc |
3162 | 9 | 10 | ||
3163 | 11 | # This is restart is necessary because of the variable possible number of session | ||
3164 | 12 | # disconnect checks at the end of the previous test | ||
3165 | 13 | --source include/restart_mysqld.inc | ||
3166 | 14 | |||
3167 | 10 | SET GLOBAL log_slow_rate_type='query'; | 15 | SET GLOBAL log_slow_rate_type='query'; |
3168 | 11 | SET GLOBAL log_slow_rate_limit=2; | 16 | SET GLOBAL log_slow_rate_limit=2; |
3169 | 17 | --let log_file=percona.slow_extended.log_slow_rate_limit_2 | ||
3170 | 12 | --source include/percona_slow_query_log_rate.inc | 18 | --source include/percona_slow_query_log_rate.inc |
3171 | 13 | 19 | ||
3172 | 14 | SET GLOBAL long_query_time=default; | 20 | SET GLOBAL long_query_time=default; |
3173 | 15 | SET GLOBAL log_slow_rate_type=default; | 21 | SET GLOBAL log_slow_rate_type=default; |
3174 | 16 | SET GLOBAL log_slow_rate_limit=default; | 22 | SET GLOBAL log_slow_rate_limit=default; |
3175 | 23 | --source include/log_cleanup.inc | ||
3176 | 17 | 24 | ||
3177 | === added file 'Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test' | |||
3178 | --- Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test 1970-01-01 00:00:00 +0000 | |||
3179 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test 2013-01-21 06:27:51 +0000 | |||
3180 | @@ -0,0 +1,21 @@ | |||
3181 | 1 | # | ||
3182 | 2 | # Test slow_query_log_timestamp_always variable. It's missing tests for FALSE value that | ||
3183 | 3 | # the log entries with the same timestamp are indeed not timestamped, but this is | ||
3184 | 4 | # impossible to test in MTR without debug injections. | ||
3185 | 5 | # | ||
3186 | 6 | SET SESSION min_examined_row_limit=0; | ||
3187 | 7 | SET SESSION long_query_time=0; | ||
3188 | 8 | SET GLOBAL slow_query_log_timestamp_always=TRUE; | ||
3189 | 9 | |||
3190 | 10 | --let log_file=percona_slow_extended_query_log_1 | ||
3191 | 11 | --source include/log_start.inc | ||
3192 | 12 | SELECT 1; | ||
3193 | 13 | SELECT 2; | ||
3194 | 14 | --source include/log_stop.inc | ||
3195 | 15 | --let grep_pattern= ^# Time: \d{6} (\d| )\d:\d\d:\d\d\$ | ||
3196 | 16 | --source include/log_grep.inc | ||
3197 | 17 | |||
3198 | 18 | SET GLOBAL slow_query_log_timestamp_always=default; | ||
3199 | 19 | SET SESSION long_query_time=default; | ||
3200 | 20 | SET SESSION min_examined_row_limit=default; | ||
3201 | 21 | --source include/log_cleanup.inc | ||
3202 | 0 | 22 | ||
3203 | === removed file 'Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test' | |||
3204 | --- Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test 2012-04-18 23:25:38 +0000 | |||
3205 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_always.test 1970-01-01 00:00:00 +0000 | |||
3206 | @@ -1,34 +0,0 @@ | |||
3207 | 1 | --source include/have_debug.inc | ||
3208 | 2 | |||
3209 | 3 | SET long_query_time=2; | ||
3210 | 4 | SET GLOBAL slow_query_log_timestamp_always=ON; | ||
3211 | 5 | --let log_file=percona.slow_extended.slow_query_log_timestamp_always | ||
3212 | 6 | --source include/log_start.inc | ||
3213 | 7 | |||
3214 | 8 | SET SESSION query_exec_time=2.1; | ||
3215 | 9 | SELECT 1; | ||
3216 | 10 | SELECT 1; | ||
3217 | 11 | SELECT 1; | ||
3218 | 12 | |||
3219 | 13 | SET GLOBAL slow_query_log_timestamp_always=OFF; | ||
3220 | 14 | |||
3221 | 15 | SET SESSION query_exec_time=2.1; | ||
3222 | 16 | SELECT 1; | ||
3223 | 17 | SELECT 1; | ||
3224 | 18 | SELECT 1; | ||
3225 | 19 | |||
3226 | 20 | SET GLOBAL slow_query_log_timestamp_always=ON; | ||
3227 | 21 | |||
3228 | 22 | SET SESSION query_exec_time=2.1; | ||
3229 | 23 | SELECT 1; | ||
3230 | 24 | SELECT 1; | ||
3231 | 25 | SELECT 1; | ||
3232 | 26 | |||
3233 | 27 | SET SESSION query_exec_time=default; | ||
3234 | 28 | |||
3235 | 29 | --source include/log_stop.inc | ||
3236 | 30 | SET GLOBAL slow_query_log_timestamp_always=default; | ||
3237 | 31 | SET long_query_time=default; | ||
3238 | 32 | |||
3239 | 33 | --let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+ | ||
3240 | 34 | --source include/log_grep.inc | ||
3241 | 35 | 0 | ||
3242 | === added file 'Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test' | |||
3243 | --- Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test 1970-01-01 00:00:00 +0000 | |||
3244 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test 2013-01-21 06:27:51 +0000 | |||
3245 | @@ -0,0 +1,37 @@ | |||
3246 | 1 | # | ||
3247 | 2 | # Test slow_query_log_timestamp_precision variable. | ||
3248 | 3 | # | ||
3249 | 4 | SET @old_slow_query_log_timestamp_always=@@slow_query_log_timestamp_always; | ||
3250 | 5 | SET SESSION min_examined_row_limit=0; | ||
3251 | 6 | SET long_query_time=0; | ||
3252 | 7 | SET GLOBAL slow_query_log_timestamp_always=TRUE; | ||
3253 | 8 | |||
3254 | 9 | # | ||
3255 | 10 | # microsecond | ||
3256 | 11 | # | ||
3257 | 12 | SET GLOBAL slow_query_log_timestamp_precision='microsecond'; | ||
3258 | 13 | |||
3259 | 14 | --let log_file=percona_slow_extended_1 | ||
3260 | 15 | --source include/log_start.inc | ||
3261 | 16 | SELECT 1; | ||
3262 | 17 | --source include/log_stop.inc | ||
3263 | 18 | --let grep_pattern= ^# Time: \d{6} (\d| )\d:\d\d:\d\d\.\d{6}\$ | ||
3264 | 19 | --source include/log_grep.inc | ||
3265 | 20 | |||
3266 | 21 | # | ||
3267 | 22 | # second | ||
3268 | 23 | # | ||
3269 | 24 | SET GLOBAL slow_query_log_timestamp_precision='second'; | ||
3270 | 25 | |||
3271 | 26 | --let log_file=percona_slow_extended_2 | ||
3272 | 27 | --source include/log_start.inc | ||
3273 | 28 | SELECT 1; | ||
3274 | 29 | --source include/log_stop.inc | ||
3275 | 30 | --let grep_pattern= ^# Time: \d{6} (\d| )\d:\d\d:\d\d\$ | ||
3276 | 31 | --source include/log_grep.inc | ||
3277 | 32 | |||
3278 | 33 | SET long_query_time=default; | ||
3279 | 34 | SET SESSION min_examined_row_limit=default; | ||
3280 | 35 | SET GLOBAL slow_query_log_timestamp_always=@old_slow_query_log_timestamp_always; | ||
3281 | 36 | SET GLOBAL slow_query_log_timestamp_precision=default; | ||
3282 | 37 | --source include/log_cleanup.inc | ||
3283 | 0 | 38 | ||
3284 | === removed file 'Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test' | |||
3285 | --- Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test 2012-04-18 23:25:38 +0000 | |||
3286 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_timestamp_precision.test 1970-01-01 00:00:00 +0000 | |||
3287 | @@ -1,25 +0,0 @@ | |||
3288 | 1 | --source include/have_debug.inc | ||
3289 | 2 | |||
3290 | 3 | SET long_query_time=2; | ||
3291 | 4 | --let log_file=percona.slow_extended.slow_query_log_timestamp_precision | ||
3292 | 5 | --source include/log_start.inc | ||
3293 | 6 | |||
3294 | 7 | SET SESSION query_exec_time=2.1; | ||
3295 | 8 | |||
3296 | 9 | SELECT 1; | ||
3297 | 10 | |||
3298 | 11 | SET GLOBAL slow_query_log_timestamp_precision='microsecond'; | ||
3299 | 12 | |||
3300 | 13 | SELECT 1; | ||
3301 | 14 | |||
3302 | 15 | SET SESSION query_exec_time=default; | ||
3303 | 16 | |||
3304 | 17 | --source include/log_stop.inc | ||
3305 | 18 | SET GLOBAL slow_query_log_timestamp_precision=default; | ||
3306 | 19 | SET long_query_time=default; | ||
3307 | 20 | |||
3308 | 21 | --let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+ | ||
3309 | 22 | --source include/log_grep.inc | ||
3310 | 23 | |||
3311 | 24 | --let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+ | ||
3312 | 25 | --source include/log_grep.inc | ||
3313 | 26 | 0 | ||
3314 | === added file 'Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test' | |||
3315 | --- Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test 1970-01-01 00:00:00 +0000 | |||
3316 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test 2013-01-21 06:27:51 +0000 | |||
3317 | @@ -0,0 +1,31 @@ | |||
3318 | 1 | --source include/have_debug.inc | ||
3319 | 2 | --source include/have_innodb.inc | ||
3320 | 3 | |||
3321 | 4 | SET SESSION min_examined_row_limit=0; | ||
3322 | 5 | SET GLOBAL long_query_time=1; | ||
3323 | 6 | |||
3324 | 7 | --let log_file=percona.slow_extended.slow_query_log_use_global_control | ||
3325 | 8 | --source include/log_start.inc | ||
3326 | 9 | |||
3327 | 10 | SET SESSION query_exec_time=1.1; | ||
3328 | 11 | |||
3329 | 12 | SELECT 1; | ||
3330 | 13 | |||
3331 | 14 | SET GLOBAL log_slow_verbosity=innodb; | ||
3332 | 15 | SET GLOBAL slow_query_log_use_global_control="log_slow_verbosity,long_query_time"; | ||
3333 | 16 | |||
3334 | 17 | SELECT 1; | ||
3335 | 18 | |||
3336 | 19 | SET SESSION query_exec_time=default; | ||
3337 | 20 | |||
3338 | 21 | --source include/log_stop.inc | ||
3339 | 22 | |||
3340 | 23 | SET GLOBAL slow_query_log_use_global_control=''; | ||
3341 | 24 | SET GLOBAL log_slow_verbosity=''; | ||
3342 | 25 | SET GLOBAL long_query_time=default; | ||
3343 | 26 | SET SESSION min_examined_row_limit=default; | ||
3344 | 27 | |||
3345 | 28 | --let grep_pattern = No InnoDB statistics available for this query | ||
3346 | 29 | --source include/log_grep.inc | ||
3347 | 30 | |||
3348 | 31 | --source include/log_cleanup.inc | ||
3349 | 0 | 32 | ||
3350 | === removed file 'Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test' | |||
3351 | --- Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test 2012-04-18 23:25:38 +0000 | |||
3352 | +++ Percona-Server/mysql-test/t/percona_slow_query_log_use_global_control.test 1970-01-01 00:00:00 +0000 | |||
3353 | @@ -1,28 +0,0 @@ | |||
3354 | 1 | --source include/have_debug.inc | ||
3355 | 2 | --source include/have_innodb.inc | ||
3356 | 3 | |||
3357 | 4 | SET GLOBAL long_query_time=1; | ||
3358 | 5 | |||
3359 | 6 | --let log_file=percona.slow_extended.slow_query_log_use_global_control | ||
3360 | 7 | --source include/log_start.inc | ||
3361 | 8 | |||
3362 | 9 | SET SESSION query_exec_time=1.1; | ||
3363 | 10 | SELECT 1; | ||
3364 | 11 | |||
3365 | 12 | SET GLOBAL log_slow_verbosity=innodb; | ||
3366 | 13 | SET GLOBAL slow_query_log_use_global_control="log_slow_verbosity,long_query_time"; | ||
3367 | 14 | |||
3368 | 15 | SELECT 1; | ||
3369 | 16 | |||
3370 | 17 | SET SESSION query_exec_time=default; | ||
3371 | 18 | |||
3372 | 19 | --source include/log_stop.inc | ||
3373 | 20 | |||
3374 | 21 | |||
3375 | 22 | SET GLOBAL slow_query_log_use_global_control=default; | ||
3376 | 23 | SET GLOBAL log_slow_verbosity=default; | ||
3377 | 24 | SET GLOBAL long_query_time=default; | ||
3378 | 25 | |||
3379 | 26 | --let grep_pattern = No InnoDB statistics available for this query | ||
3380 | 27 | --source include/log_grep.inc | ||
3381 | 28 | |||
3382 | 29 | 0 | ||
3383 | === modified file 'Percona-Server/sql/event_scheduler.cc' | |||
3384 | --- Percona-Server/sql/event_scheduler.cc 2012-09-17 13:08:32 +0000 | |||
3385 | +++ Percona-Server/sql/event_scheduler.cc 2013-01-21 06:27:51 +0000 | |||
3386 | @@ -195,7 +195,6 @@ | |||
3387 | 195 | thd->client_capabilities|= CLIENT_MULTI_RESULTS; | 195 | thd->client_capabilities|= CLIENT_MULTI_RESULTS; |
3388 | 196 | mysql_mutex_lock(&LOCK_thread_count); | 196 | mysql_mutex_lock(&LOCK_thread_count); |
3389 | 197 | thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; | 197 | thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; |
3390 | 198 | thd->write_to_slow_log= true; | ||
3391 | 199 | mysql_mutex_unlock(&LOCK_thread_count); | 198 | mysql_mutex_unlock(&LOCK_thread_count); |
3392 | 200 | 199 | ||
3393 | 201 | /* | 200 | /* |
3394 | 202 | 201 | ||
3395 | === modified file 'Percona-Server/sql/log.cc' | |||
3396 | --- Percona-Server/sql/log.cc 2013-01-09 23:45:25 +0000 | |||
3397 | +++ Percona-Server/sql/log.cc 2013-01-21 06:27:51 +0000 | |||
3398 | @@ -1220,7 +1220,7 @@ | |||
3399 | 1220 | 1220 | ||
3400 | 1221 | if (*slow_log_handler_list) | 1221 | if (*slow_log_handler_list) |
3401 | 1222 | { | 1222 | { |
3403 | 1223 | /* do not log slow queries from replication threads */ | 1223 | /* do not log slow queries from replication threads, unless requested */ |
3404 | 1224 | if (thd->slave_thread && !opt_log_slow_slave_statements) | 1224 | if (thd->slave_thread && !opt_log_slow_slave_statements) |
3405 | 1225 | return 0; | 1225 | return 0; |
3406 | 1226 | 1226 | ||
3407 | @@ -2709,6 +2709,9 @@ | |||
3408 | 2709 | char buff[80], *end; | 2709 | char buff[80], *end; |
3409 | 2710 | char query_time_buff[22+7], lock_time_buff[22+7]; | 2710 | char query_time_buff[22+7], lock_time_buff[22+7]; |
3410 | 2711 | uint buff_len; | 2711 | uint buff_len; |
3411 | 2712 | char sent_row_buff[21]; // max ulonglong val in dec is 20 digits | ||
3412 | 2713 | char examined_row_buff[21]; | ||
3413 | 2714 | char affected_row_buff[21]; | ||
3414 | 2712 | end= buff; | 2715 | end= buff; |
3415 | 2713 | 2716 | ||
3416 | 2714 | if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT)) | 2717 | if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT)) |
3417 | @@ -2722,7 +2725,7 @@ | |||
3418 | 2722 | { | 2725 | { |
3419 | 2723 | ulonglong microsecond = current_utime % (1000 * 1000); | 2726 | ulonglong microsecond = current_utime % (1000 * 1000); |
3420 | 2724 | buff_len= snprintf(buff, sizeof buff, | 2727 | buff_len= snprintf(buff, sizeof buff, |
3422 | 2725 | "# Time: %02d%02d%02d %2d:%02d:%02d.%010lld\n", | 2728 | "# Time: %02d%02d%02d %2d:%02d:%02d.%06lld\n", |
3423 | 2726 | start.tm_year % 100, start.tm_mon + 1, | 2729 | start.tm_year % 100, start.tm_mon + 1, |
3424 | 2727 | start.tm_mday, start.tm_hour, | 2730 | start.tm_mday, start.tm_hour, |
3425 | 2728 | start.tm_min, start.tm_sec,microsecond); | 2731 | start.tm_min, start.tm_sec,microsecond); |
3426 | @@ -2751,28 +2754,49 @@ | |||
3427 | 2751 | /* For slow query log */ | 2754 | /* For slow query log */ |
3428 | 2752 | sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0); | 2755 | sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0); |
3429 | 2753 | sprintf(lock_time_buff, "%.6f", ulonglong2double(lock_utime)/1000000.0); | 2756 | sprintf(lock_time_buff, "%.6f", ulonglong2double(lock_utime)/1000000.0); |
3431 | 2754 | DBUG_PRINT("info", ("Last_errno: %u", thd->last_errno)); | 2757 | /* Here and below sprintf is used because my_b_printf does not support %llu |
3432 | 2758 | natively. snprintf is not used as there is no way to overflow the buffer | ||
3433 | 2759 | for 64-bit integers and MySQL assumes it to be available on less systems | ||
3434 | 2760 | than sprintf. */ | ||
3435 | 2761 | sprintf(sent_row_buff, "%llu", (ulonglong)thd->sent_row_count); | ||
3436 | 2762 | sprintf(examined_row_buff, "%llu", (ulonglong)thd->examined_row_count); | ||
3437 | 2763 | sprintf(affected_row_buff, "%llu", (thd->get_row_count_func() > 0) | ||
3438 | 2764 | ? (ulonglong) thd->get_row_count_func() : 0); | ||
3439 | 2755 | if (my_b_printf(&log_file, | 2765 | if (my_b_printf(&log_file, |
3443 | 2756 | "# Thread_id: %lu Schema: %s Last_errno: %u Killed: %u\n" \ | 2766 | "# Thread_id: %lu Schema: %s Last_errno: %d " |
3444 | 2757 | "# Query_time: %s Lock_time: %s Rows_sent: %lu Rows_examined: %lu Rows_affected: %lu Rows_read: %lu\n" | 2767 | "Killed: %u\n" |
3445 | 2758 | "# Bytes_sent: %lu Tmp_tables: %lu Tmp_disk_tables: %lu Tmp_table_sizes: %lu\n", | 2768 | "# Query_time: %s Lock_time: %s Rows_sent: %s " |
3446 | 2769 | "Rows_examined: %s Rows_affected: %s Rows_read: %s\n" | ||
3447 | 2770 | "# Bytes_sent: %lu", | ||
3448 | 2759 | (ulong) thd->thread_id, (thd->db ? thd->db : ""), | 2771 | (ulong) thd->thread_id, (thd->db ? thd->db : ""), |
3449 | 2760 | thd->last_errno, (uint) thd->killed, | 2772 | thd->last_errno, (uint) thd->killed, |
3459 | 2761 | query_time_buff, lock_time_buff, | 2773 | query_time_buff, lock_time_buff, sent_row_buff, |
3460 | 2762 | (ulong) thd->sent_row_count, | 2774 | examined_row_buff, affected_row_buff, examined_row_buff, |
3461 | 2763 | (ulong) thd->examined_row_count, | 2775 | (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old)) |
3462 | 2764 | ((long) thd->get_row_count_func() > 0 ) ? (ulong) thd->get_row_count_func() : 0, | 2776 | == (uint) -1) |
3454 | 2765 | (ulong) thd->examined_row_count, | ||
3455 | 2766 | (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old), | ||
3456 | 2767 | (ulong) thd->tmp_tables_used, | ||
3457 | 2768 | (ulong) thd->tmp_tables_disk_used, | ||
3458 | 2769 | (ulong) thd->tmp_tables_size) == (uint) -1) | ||
3463 | 2770 | tmp_errno= errno; | 2777 | tmp_errno= errno; |
3464 | 2771 | 2778 | ||
3465 | 2779 | if (thd->variables.log_slow_verbosity & (1ULL << SLOG_V_QUERY_PLAN)) | ||
3466 | 2780 | { | ||
3467 | 2781 | char tmp_tables_size_buff[21]; | ||
3468 | 2782 | sprintf(tmp_tables_size_buff, "%llu", thd->tmp_tables_size); | ||
3469 | 2783 | if (my_b_printf(&log_file, | ||
3470 | 2784 | " Tmp_tables: %lu Tmp_disk_tables: %lu " | ||
3471 | 2785 | "Tmp_table_sizes: %s", | ||
3472 | 2786 | thd->tmp_tables_used, thd->tmp_tables_disk_used, | ||
3473 | 2787 | tmp_tables_size_buff) == (uint) -1) | ||
3474 | 2788 | { | ||
3475 | 2789 | tmp_errno= errno; | ||
3476 | 2790 | } | ||
3477 | 2791 | } | ||
3478 | 2792 | if (my_b_write(&log_file, (uchar*) "\n", 1)) | ||
3479 | 2793 | tmp_errno= errno; | ||
3480 | 2794 | |||
3481 | 2772 | #if defined(ENABLED_PROFILING) | 2795 | #if defined(ENABLED_PROFILING) |
3482 | 2773 | thd->profiling.print_current(&log_file); | 2796 | thd->profiling.print_current(&log_file); |
3483 | 2774 | #endif | 2797 | #endif |
3485 | 2775 | if (thd->innodb_was_used) | 2798 | if ((thd->variables.log_slow_verbosity & (1ULL << SLOG_V_INNODB)) |
3486 | 2799 | && thd->innodb_was_used) | ||
3487 | 2776 | { | 2800 | { |
3488 | 2777 | char buf[20]; | 2801 | char buf[20]; |
3489 | 2778 | snprintf(buf, 20, "%llX", thd->innodb_trx_id); | 2802 | snprintf(buf, 20, "%llX", thd->innodb_trx_id); |
3490 | @@ -2796,18 +2820,20 @@ | |||
3491 | 2796 | if ((thd->variables.log_slow_verbosity & (ULL(1) << SLOG_V_INNODB)) && thd->innodb_was_used) | 2820 | if ((thd->variables.log_slow_verbosity & (ULL(1) << SLOG_V_INNODB)) && thd->innodb_was_used) |
3492 | 2797 | { | 2821 | { |
3493 | 2798 | char buf[3][20]; | 2822 | char buf[3][20]; |
3494 | 2823 | char io_read_buff[21]; | ||
3495 | 2799 | snprintf(buf[0], 20, "%.6f", thd->innodb_io_reads_wait_timer / 1000000.0); | 2824 | snprintf(buf[0], 20, "%.6f", thd->innodb_io_reads_wait_timer / 1000000.0); |
3496 | 2800 | snprintf(buf[1], 20, "%.6f", thd->innodb_lock_que_wait_timer / 1000000.0); | 2825 | snprintf(buf[1], 20, "%.6f", thd->innodb_lock_que_wait_timer / 1000000.0); |
3497 | 2801 | snprintf(buf[2], 20, "%.6f", thd->innodb_innodb_que_wait_timer / 1000000.0); | 2826 | snprintf(buf[2], 20, "%.6f", thd->innodb_innodb_que_wait_timer / 1000000.0); |
3498 | 2827 | sprintf(io_read_buff, "%llu", thd->innodb_io_read); | ||
3499 | 2802 | if (my_b_printf(&log_file, | 2828 | if (my_b_printf(&log_file, |
3502 | 2803 | "# InnoDB_IO_r_ops: %lu InnoDB_IO_r_bytes: %lu InnoDB_IO_r_wait: %s\n" \ | 2829 | "# InnoDB_IO_r_ops: %lu InnoDB_IO_r_bytes: %s " |
3503 | 2804 | "# InnoDB_rec_lock_wait: %s InnoDB_queue_wait: %s\n" \ | 2830 | "InnoDB_IO_r_wait: %s\n" |
3504 | 2831 | "# InnoDB_rec_lock_wait: %s InnoDB_queue_wait: %s\n" | ||
3505 | 2805 | "# InnoDB_pages_distinct: %lu\n", | 2832 | "# InnoDB_pages_distinct: %lu\n", |
3511 | 2806 | (ulong) thd->innodb_io_reads, | 2833 | thd->innodb_io_reads, io_read_buff, |
3512 | 2807 | (ulong) thd->innodb_io_read, | 2834 | buf[0], buf[1], buf[2], thd->innodb_page_access) |
3513 | 2808 | buf[0], buf[1], buf[2], | 2835 | == (uint) -1) |
3514 | 2809 | (ulong) thd->innodb_page_access) == (uint) -1) | 2836 | tmp_errno= errno; |
3510 | 2810 | tmp_errno=errno; | ||
3515 | 2811 | } | 2837 | } |
3516 | 2812 | else | 2838 | else |
3517 | 2813 | { | 2839 | { |
3518 | 2814 | 2840 | ||
3519 | === modified file 'Percona-Server/sql/log_event.cc' | |||
3520 | --- Percona-Server/sql/log_event.cc 2013-01-09 23:46:01 +0000 | |||
3521 | +++ Percona-Server/sql/log_event.cc 2013-01-21 06:27:51 +0000 | |||
3522 | @@ -3511,7 +3511,7 @@ | |||
3523 | 3511 | thd->enable_slow_log is set to the value of | 3511 | thd->enable_slow_log is set to the value of |
3524 | 3512 | opt_log_slow_admin_statements). | 3512 | opt_log_slow_admin_statements). |
3525 | 3513 | */ | 3513 | */ |
3527 | 3514 | thd->enable_slow_log= opt_log_slow_slave_statements; | 3514 | thd->enable_slow_log= TRUE; |
3528 | 3515 | } | 3515 | } |
3529 | 3516 | else | 3516 | else |
3530 | 3517 | { | 3517 | { |
3531 | 3518 | 3518 | ||
3532 | === modified file 'Percona-Server/sql/slave.cc' | |||
3533 | --- Percona-Server/sql/slave.cc 2012-09-17 13:08:32 +0000 | |||
3534 | +++ Percona-Server/sql/slave.cc 2013-01-21 06:27:51 +0000 | |||
3535 | @@ -2086,8 +2086,7 @@ | |||
3536 | 2086 | */ | 2086 | */ |
3537 | 2087 | thd->variables.max_allowed_packet= slave_max_allowed_packet; | 2087 | thd->variables.max_allowed_packet= slave_max_allowed_packet; |
3538 | 2088 | thd->slave_thread = 1; | 2088 | thd->slave_thread = 1; |
3541 | 2089 | thd->enable_slow_log= opt_log_slow_slave_statements; | 2089 | thd->enable_slow_log= TRUE; |
3540 | 2090 | thd->write_to_slow_log= opt_log_slow_slave_statements; | ||
3542 | 2091 | set_slave_thread_options(thd); | 2090 | set_slave_thread_options(thd); |
3543 | 2092 | thd->client_capabilities = CLIENT_LOCAL_FILES; | 2091 | thd->client_capabilities = CLIENT_LOCAL_FILES; |
3544 | 2093 | mysql_mutex_lock(&LOCK_thread_count); | 2092 | mysql_mutex_lock(&LOCK_thread_count); |
3545 | 2094 | 2093 | ||
3546 | === modified file 'Percona-Server/sql/sql_class.cc' | |||
3547 | --- Percona-Server/sql/sql_class.cc 2012-10-27 05:16:07 +0000 | |||
3548 | +++ Percona-Server/sql/sql_class.cc 2013-01-21 06:27:51 +0000 | |||
3549 | @@ -4112,11 +4112,6 @@ | |||
3550 | 4112 | } | 4112 | } |
3551 | 4113 | #endif /* DBUG_OFF */ | 4113 | #endif /* DBUG_OFF */ |
3552 | 4114 | query_id= new_query_id; | 4114 | query_id= new_query_id; |
3553 | 4115 | if (opt_slow_query_log_rate_type == SLOG_RT_QUERY) | ||
3554 | 4116 | { | ||
3555 | 4117 | const ulong& limit= variables.log_slow_rate_limit; | ||
3556 | 4118 | write_to_slow_log= limit == 0 || (query_id % limit) == 0; | ||
3557 | 4119 | } | ||
3558 | 4120 | } | 4115 | } |
3559 | 4121 | 4116 | ||
3560 | 4122 | /** Assign a new value to thd->mysys_var. */ | 4117 | /** Assign a new value to thd->mysys_var. */ |
3561 | 4123 | 4118 | ||
3562 | === modified file 'Percona-Server/sql/sql_class.h' | |||
3563 | --- Percona-Server/sql/sql_class.h 2012-12-14 03:09:41 +0000 | |||
3564 | +++ Percona-Server/sql/sql_class.h 2013-01-21 06:27:51 +0000 | |||
3565 | @@ -80,14 +80,14 @@ | |||
3566 | 80 | SLOG_RT_SESSION, SLOG_RT_QUERY | 80 | SLOG_RT_SESSION, SLOG_RT_QUERY |
3567 | 81 | }; | 81 | }; |
3568 | 82 | #define QPLAN_NONE 0 | 82 | #define QPLAN_NONE 0 |
3577 | 83 | #define QPLAN_QC 1 << 0 | 83 | #define QPLAN_QC_NO (1 << 0) |
3578 | 84 | #define QPLAN_QC_NO 1 << 1 | 84 | #define QPLAN_FULL_SCAN (1 << 1) |
3579 | 85 | #define QPLAN_FULL_SCAN 1 << 2 | 85 | #define QPLAN_FULL_JOIN (1 << 2) |
3580 | 86 | #define QPLAN_FULL_JOIN 1 << 3 | 86 | #define QPLAN_TMP_TABLE (1 << 3) |
3581 | 87 | #define QPLAN_TMP_TABLE 1 << 4 | 87 | #define QPLAN_TMP_DISK (1 << 4) |
3582 | 88 | #define QPLAN_TMP_DISK 1 << 5 | 88 | #define QPLAN_FILESORT (1 << 5) |
3583 | 89 | #define QPLAN_FILESORT 1 << 6 | 89 | #define QPLAN_FILESORT_DISK (1 << 6) |
3584 | 90 | #define QPLAN_FILESORT_DISK 1 << 7 | 90 | #define QPLAN_QC (1 << 7) |
3585 | 91 | enum enum_log_slow_filter { | 91 | enum enum_log_slow_filter { |
3586 | 92 | SLOG_F_QC_NO, SLOG_F_FULL_SCAN, SLOG_F_FULL_JOIN, | 92 | SLOG_F_QC_NO, SLOG_F_FULL_SCAN, SLOG_F_FULL_JOIN, |
3587 | 93 | SLOG_F_TMP_TABLE, SLOG_F_TMP_DISK, SLOG_F_FILESORT, | 93 | SLOG_F_TMP_TABLE, SLOG_F_TMP_DISK, SLOG_F_FILESORT, |
3588 | @@ -1670,18 +1670,6 @@ | |||
3589 | 1670 | 1670 | ||
3590 | 1671 | /*** Following variables used in slow_extended.patch ***/ | 1671 | /*** Following variables used in slow_extended.patch ***/ |
3591 | 1672 | /* | 1672 | /* |
3592 | 1673 | Variable write_to_slow_log: | ||
3593 | 1674 | 1) initialized in | ||
3594 | 1675 | * sql_connect.cc (log_slow_rate_limit support) | ||
3595 | 1676 | * slave.cc (log_slow_slave_statements support) | ||
3596 | 1677 | 2) The variable is initialized on the thread startup and remains | ||
3597 | 1678 | constant afterwards. This will change when | ||
3598 | 1679 | LP #712396 ("log_slow_slave_statements not work on replication | ||
3599 | 1680 | threads without RESTART") is implemented. | ||
3600 | 1681 | 3) An implementation of LP #688646 ("Make query sampling possible by query") should use it. | ||
3601 | 1682 | */ | ||
3602 | 1683 | bool write_to_slow_log; | ||
3603 | 1684 | /* | ||
3604 | 1685 | Variable bytes_send_old saves value of thd->status_var.bytes_sent | 1673 | Variable bytes_send_old saves value of thd->status_var.bytes_sent |
3605 | 1686 | before query execution. | 1674 | before query execution. |
3606 | 1687 | */ | 1675 | */ |
3607 | 1688 | 1676 | ||
3608 | === modified file 'Percona-Server/sql/sql_connect.cc' | |||
3609 | --- Percona-Server/sql/sql_connect.cc 2013-01-09 23:45:25 +0000 | |||
3610 | +++ Percona-Server/sql/sql_connect.cc 2013-01-21 06:27:51 +0000 | |||
3611 | @@ -1417,14 +1417,6 @@ | |||
3612 | 1417 | MYSQL_CONNECTION_START(thd->thread_id, &thd->security_ctx->priv_user[0], | 1417 | MYSQL_CONNECTION_START(thd->thread_id, &thd->security_ctx->priv_user[0], |
3613 | 1418 | (char *) thd->security_ctx->host_or_ip); | 1418 | (char *) thd->security_ctx->host_or_ip); |
3614 | 1419 | 1419 | ||
3615 | 1420 | /* | ||
3616 | 1421 | If rate limiting of slow log writes is enabled, decide whether to log this | ||
3617 | 1422 | new thread's queries or not. Uses extremely simple algorithm. :) | ||
3618 | 1423 | */ | ||
3619 | 1424 | const ulong& limit= thd->variables.log_slow_rate_limit; | ||
3620 | 1425 | thd->write_to_slow_log= opt_slow_query_log_rate_type == SLOG_RT_SESSION && | ||
3621 | 1426 | (limit == 0 || (thd->thread_id % limit) == 0); | ||
3622 | 1427 | |||
3623 | 1428 | prepare_new_connection_state(thd); | 1420 | prepare_new_connection_state(thd); |
3624 | 1429 | return FALSE; | 1421 | return FALSE; |
3625 | 1430 | } | 1422 | } |
3626 | 1431 | 1423 | ||
3627 | === modified file 'Percona-Server/sql/sql_parse.cc' | |||
3628 | --- Percona-Server/sql/sql_parse.cc 2013-01-09 23:45:25 +0000 | |||
3629 | +++ Percona-Server/sql/sql_parse.cc 2013-01-21 06:27:51 +0000 | |||
3630 | @@ -1535,7 +1535,7 @@ | |||
3631 | 1535 | /* Follow the slow log filter configuration. */ | 1535 | /* Follow the slow log filter configuration. */ |
3632 | 1536 | if (thd->variables.log_slow_filter != 0 && | 1536 | if (thd->variables.log_slow_filter != 0 && |
3633 | 1537 | (!(thd->variables.log_slow_filter & thd->query_plan_flags) || | 1537 | (!(thd->variables.log_slow_filter & thd->query_plan_flags) || |
3635 | 1538 | ((thd->variables.log_slow_filter & SLOG_F_QC_NO) && | 1538 | ((thd->variables.log_slow_filter & (1UL << SLOG_F_QC_NO)) && |
3636 | 1539 | (thd->query_plan_flags & QPLAN_QC)))) | 1539 | (thd->query_plan_flags & QPLAN_QC)))) |
3637 | 1540 | DBUG_VOID_RETURN; | 1540 | DBUG_VOID_RETURN; |
3638 | 1541 | 1541 | ||
3639 | @@ -1567,10 +1567,20 @@ | |||
3640 | 1567 | copy_global_to_session(thd, SLOG_UG_MIN_EXAMINED_ROW_LIMIT, | 1567 | copy_global_to_session(thd, SLOG_UG_MIN_EXAMINED_ROW_LIMIT, |
3641 | 1568 | &g.min_examined_row_limit); | 1568 | &g.min_examined_row_limit); |
3642 | 1569 | 1569 | ||
3647 | 1570 | /* Do not log this thread's queries due to rate limiting. */ | 1570 | if (opt_slow_query_log_rate_type == SLOG_RT_QUERY |
3648 | 1571 | if (!thd->write_to_slow_log && (thd->variables.long_query_time >= 1000000 | 1571 | && thd->variables.log_slow_rate_limit |
3649 | 1572 | || (ulong) query_exec_time < 1000000)) | 1572 | && thd->query_id % thd->variables.log_slow_rate_limit |
3650 | 1573 | DBUG_VOID_RETURN; | 1573 | && (thd->variables.long_query_time >= 1000000 |
3651 | 1574 | || (ulong) query_exec_time < 1000000)) { | ||
3652 | 1575 | DBUG_VOID_RETURN; | ||
3653 | 1576 | } | ||
3654 | 1577 | if (opt_slow_query_log_rate_type == SLOG_RT_SESSION | ||
3655 | 1578 | && thd->variables.log_slow_rate_limit | ||
3656 | 1579 | && thd->thread_id % thd->variables.log_slow_rate_limit | ||
3657 | 1580 | && (thd->variables.long_query_time >= 1000000 | ||
3658 | 1581 | || (ulong) query_exec_time < 1000000)) { | ||
3659 | 1582 | DBUG_VOID_RETURN; | ||
3660 | 1583 | } | ||
3661 | 1574 | 1584 | ||
3662 | 1575 | 1585 | ||
3663 | 1576 | /* | 1586 | /* |
3664 | 1577 | 1587 | ||
3665 | === modified file 'Percona-Server/sql/sys_vars.cc' | |||
3666 | --- Percona-Server/sql/sys_vars.cc 2012-10-17 03:47:45 +0000 | |||
3667 | +++ Percona-Server/sql/sys_vars.cc 2013-01-21 06:27:51 +0000 | |||
3668 | @@ -3205,7 +3205,8 @@ | |||
3669 | 3205 | const char *slow_query_log_timestamp_precision_name[]= { "second", "microsecond", 0 }; | 3205 | const char *slow_query_log_timestamp_precision_name[]= { "second", "microsecond", 0 }; |
3670 | 3206 | static Sys_var_enum Sys_slow_query_log_timestamp_precision( | 3206 | static Sys_var_enum Sys_slow_query_log_timestamp_precision( |
3671 | 3207 | "slow_query_log_timestamp_precision", | 3207 | "slow_query_log_timestamp_precision", |
3673 | 3208 | "Log slow statements executed by stored procedure to the slow log if it is open. [second, microsecond]", | 3208 | "Select the timestamp precision for use in the slow query log. " |
3674 | 3209 | "[second, microsecond]", | ||
3675 | 3209 | GLOBAL_VAR(opt_slow_query_log_timestamp_precision), CMD_LINE(REQUIRED_ARG), | 3210 | GLOBAL_VAR(opt_slow_query_log_timestamp_precision), CMD_LINE(REQUIRED_ARG), |
3676 | 3210 | slow_query_log_timestamp_precision_name, DEFAULT(SLOG_SECOND)); | 3211 | slow_query_log_timestamp_precision_name, DEFAULT(SLOG_SECOND)); |
3677 | 3211 | 3212 | ||
3678 | 3212 | 3213 | ||
3679 | === modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc' | |||
3680 | --- Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-01-18 03:34:53 +0000 | |||
3681 | +++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-01-21 06:27:51 +0000 | |||
3682 | @@ -1779,7 +1779,7 @@ | |||
3683 | 1779 | trx->fake_changes = THDVAR(thd, fake_changes); | 1779 | trx->fake_changes = THDVAR(thd, fake_changes); |
3684 | 1780 | 1780 | ||
3685 | 1781 | #ifdef EXTENDED_SLOWLOG | 1781 | #ifdef EXTENDED_SLOWLOG |
3687 | 1782 | if (thd_log_slow_verbosity(thd) & SLOG_V_INNODB) { | 1782 | if (thd_log_slow_verbosity(thd) & (1ULL << SLOG_V_INNODB)) { |
3688 | 1783 | trx->take_stats = TRUE; | 1783 | trx->take_stats = TRUE; |
3689 | 1784 | } else { | 1784 | } else { |
3690 | 1785 | trx->take_stats = FALSE; | 1785 | trx->take_stats = FALSE; |