Merge lp:~percona-dev/percona-server/release-5.1.53-bug693818 into lp:~percona-dev/percona-server/release-5.1.53

Proposed by Alexey Kopytov on 2010-12-28
Status: Merged
Approved by: Vadim Tkachenko on 2010-12-29
Approved revision: 177
Merged at revision: 177
Proposed branch: lp:~percona-dev/percona-server/release-5.1.53-bug693818
Merge into: lp:~percona-dev/percona-server/release-5.1.53
Diff against target: 314 lines (+87/-40)
12 files modified
mysql-test/slow_extended.patch/grep.inc (+16/-0)
mysql-test/slow_extended.patch/percona_slow_extended-control_global_slow.test (+5/-2)
mysql-test/slow_extended.patch/percona_slow_extended-log_slow_filter.test (+4/-2)
mysql-test/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test (+4/-2)
mysql-test/slow_extended.patch/percona_slow_extended-long_query_time.test (+4/-2)
mysql-test/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test (+8/-5)
mysql-test/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test (+4/-2)
mysql-test/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test (+3/-1)
mysql-test/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test (+6/-6)
mysql-test/slow_extended.patch/percona_slow_extended-slave_statements.test (+6/-6)
mysql-test/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test (+3/-2)
slow_extended.patch (+24/-10)
To merge this branch: bzr merge lp:~percona-dev/percona-server/release-5.1.53-bug693818
Reviewer Review Type Date Requested Status
Vadim Tkachenko 2010-12-28 Approve on 2010-12-29
Review via email: mp+44812@code.launchpad.net
To post a comment you must log in.
Vadim Tkachenko (vadim-tk) wrote :

please propose the merge to lp:percona-server ( 5.1.54) also

review: Needs Fixing
Oleg Tsarev (tsarev) wrote :
Vadim Tkachenko (vadim-tk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'mysql-test/slow_extended.patch/grep.inc'
2--- mysql-test/slow_extended.patch/grep.inc 1970-01-01 00:00:00 +0000
3+++ mysql-test/slow_extended.patch/grep.inc 2010-12-28 22:47:52 +0000
4@@ -0,0 +1,16 @@
5+perl;
6+
7+ $file = $ENV{'grep_file'};
8+ $pattern = $ENV{'grep_pattern'};
9+
10+ open(FILE, "$file")
11+ or die("Cannot open file $file: $!\n");
12+
13+ $lines = 0;
14+ while(<FILE>) {
15+ $lines++ if (/$pattern/);
16+ }
17+ print "$lines\n";
18+
19+ close(FILE);
20+EOF
21
22=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-control_global_slow.test'
23--- mysql-test/slow_extended.patch/percona_slow_extended-control_global_slow.test 2010-12-06 03:50:48 +0000
24+++ mysql-test/slow_extended.patch/percona_slow_extended-control_global_slow.test 2010-12-28 22:47:52 +0000
25@@ -5,5 +5,8 @@
26 SELECT sleep(2);
27 set global use_global_log_slow_control=none;
28 set global log_slow_verbosity=microtime;
29-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l;
30-exec $cmd;
31+
32+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-control_global_slow.log
33+--let grep_pattern = No InnoDB statistics available for this query
34+
35+--source include/grep.inc
36
37=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-log_slow_filter.test'
38--- mysql-test/slow_extended.patch/percona_slow_extended-log_slow_filter.test 2010-12-06 03:50:48 +0000
39+++ mysql-test/slow_extended.patch/percona_slow_extended-log_slow_filter.test 2010-12-28 22:47:52 +0000
40@@ -26,5 +26,7 @@
41 drop table if exists t;
42 --enable_warnings
43
44-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l;
45-exec $cmd;
46+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_filter.log
47+--let grep_pattern = Query_time
48+
49+--source include/grep.inc
50
51=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test'
52--- mysql-test/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test 2010-12-06 03:50:48 +0000
53+++ mysql-test/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test 2010-12-28 22:47:52 +0000
54@@ -6,5 +6,7 @@
55
56 SELECT sleep(2);
57
58-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l;
59-exec $cmd;
60+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log
61+--let grep_pattern = No InnoDB statistics available for this query
62+
63+--source include/grep.inc
64
65=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-long_query_time.test'
66--- mysql-test/slow_extended.patch/percona_slow_extended-long_query_time.test 2010-12-06 03:50:48 +0000
67+++ mysql-test/slow_extended.patch/percona_slow_extended-long_query_time.test 2010-12-28 22:47:52 +0000
68@@ -12,5 +12,7 @@
69
70 set long_query_time=2;
71
72-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l;
73-exec $cmd;
74+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-long_query_time.log
75+--let grep_pattern = Query_time
76+--source include/grep.inc
77+
78
79=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test'
80--- mysql-test/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test 2010-12-06 03:50:48 +0000
81+++ mysql-test/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test 2010-12-28 22:47:52 +0000
82@@ -8,8 +8,11 @@
83
84 set global slow_query_log_microseconds_timestamp=OFF;
85
86-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l;
87-exec $cmd;
88-
89-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l;
90-exec $cmd;
91+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
92+--let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+
93+--source include/grep.inc
94+
95+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
96+--let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+
97+--source include/grep.inc
98+
99
100=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test'
101--- mysql-test/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test 2010-12-06 03:50:48 +0000
102+++ mysql-test/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test 2010-12-28 22:47:52 +0000
103@@ -26,5 +26,7 @@
104 drop table if exists t;
105 --enable_warnings
106
107-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l;
108-exec $cmd;
109+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log
110+--let grep_pattern = Query_time
111+--source include/grep.inc
112+
113
114=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test'
115--- mysql-test/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test 2010-12-06 03:50:48 +0000
116+++ mysql-test/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test 2010-12-28 22:47:52 +0000
117@@ -41,4 +41,6 @@
118 DROP TABLE IF EXISTS t;
119 sync_slave_with_master;
120
121-exec cat $MYSQLTEST_VARDIR/mysqld.2/mysqld-slow.log | grep InnoDB_IO_r_ops | wc -l;
122+--let grep_file = $MYSQLTEST_VARDIR/mysqld.2/mysqld-slow.log
123+--let grep_pattern = InnoDB_IO_r_ops
124+--source include/grep.inc
125
126=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test'
127--- mysql-test/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test 2010-11-18 11:47:03 +0000
128+++ mysql-test/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test 2010-12-28 22:47:52 +0000
129@@ -78,11 +78,11 @@
130 -- echo # Analyse master slow_query_log
131 let $i=5;
132 let $k=1;
133-let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
134 while($i)
135 {
136- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
137- exec $current_cmd;
138+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
139+ --let grep_pattern = INSERT INTO t VALUES \($k\)
140+ --source include/grep.inc
141 dec $i;
142 inc $k;
143 }
144@@ -90,11 +90,11 @@
145 -- echo # Analyse slave slow_query_log
146 let $i=5;
147 let $k=1;
148-let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
149 while($i)
150 {
151- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
152- exec $current_cmd;
153+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
154+ --let grep_pattern = INSERT INTO t VALUES \($k\)
155+ --source include/grep.inc
156 dec $i;
157 inc $k;
158 }
159
160=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-slave_statements.test'
161--- mysql-test/slow_extended.patch/percona_slow_extended-slave_statements.test 2010-11-18 12:19:15 +0000
162+++ mysql-test/slow_extended.patch/percona_slow_extended-slave_statements.test 2010-12-28 22:47:52 +0000
163@@ -125,11 +125,11 @@
164 -- echo # Analyse master slow_query_log
165 let $i=7;
166 let $k=1;
167-let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
168 while($i)
169 {
170- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
171- exec $current_cmd;
172+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
173+ --let grep_pattern = INSERT INTO t VALUES \($k\)
174+ --source include/grep.inc
175 dec $i;
176 inc $k;
177 }
178@@ -137,11 +137,11 @@
179 -- echo # Analyse slave slow_query_log
180 let $i=7;
181 let $k=1;
182-let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
183 while($i)
184 {
185- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
186- exec $current_cmd;
187+ --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
188+ --let grep_pattern = INSERT INTO t VALUES \($k\)
189+ --source include/grep.inc
190 dec $i;
191 inc $k;
192 }
193
194=== modified file 'mysql-test/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test'
195--- mysql-test/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test 2010-12-06 03:50:48 +0000
196+++ mysql-test/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test 2010-12-28 22:47:52 +0000
197@@ -14,8 +14,9 @@
198 set global long_query_time=2;
199 set global use_global_long_query_time=0;
200
201-let $cmd = cat $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l;
202-exec $cmd;
203+--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log
204+--let grep_pattern = Query_time
205+--source include/grep.inc
206
207 show global variables like 'use_global_log_slow_control';
208 show global variables like 'use_global_long_query_time';
209
210=== modified file 'slow_extended.patch'
211--- slow_extended.patch 2010-11-26 11:54:21 +0000
212+++ slow_extended.patch 2010-12-28 22:47:52 +0000
213@@ -195,7 +195,7 @@
214 }
215 else
216 {
217-@@ -1010,8 +1026,20 @@
218+@@ -1010,8 +1026,21 @@
219 query_length= command_name[thd->command].length;
220 }
221
222@@ -203,6 +203,7 @@
223 + {
224 + thd->sent_row_count= thd->examined_row_count= 0;
225 + thd->row_count= 0;
226++ thd->orig_row_count= 0;
227 + thd->bytes_sent_old= thd->status_var.bytes_sent;
228 + thd->tmp_tables_used= thd->tmp_tables_disk_used= 0;
229 + thd->tmp_tables_size= 0;
230@@ -217,7 +218,7 @@
231 user_host_buff, user_host_len,
232 query_utime, lock_utime, is_command,
233 query, query_length) || error;
234-@@ -2280,12 +2308,13 @@
235+@@ -2280,12 +2309,13 @@
236 TRUE - error occured
237 */
238
239@@ -232,7 +233,7 @@
240 bool error= 0;
241 DBUG_ENTER("MYSQL_QUERY_LOG::write");
242
243-@@ -2307,17 +2336,28 @@
244+@@ -2307,17 +2337,28 @@
245
246 if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT))
247 {
248@@ -268,7 +269,7 @@
249
250 /* Note that my_b_write() assumes it knows the length for this */
251 if (my_b_write(&log_file, (uchar*) buff, buff_len))
252-@@ -2335,12 +2375,64 @@
253+@@ -2335,12 +2376,64 @@
254 sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0);
255 sprintf(lock_time_buff, "%.6f", ulonglong2double(lock_utime)/1000000.0);
256 if (my_b_printf(&log_file,
257@@ -284,7 +285,7 @@
258 - (ulong) thd->examined_row_count) == (uint) -1)
259 + (ulong) thd->examined_row_count,
260 + ((long) thd->row_count_func > 0 ) ? (ulong) thd->row_count_func : 0,
261-+ (ulong) thd->row_count,
262++ thd->row_count - thd->orig_row_count + 1,
263 + (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old),
264 + (ulong) thd->tmp_tables_used,
265 + (ulong) thd->tmp_tables_disk_used,
266@@ -1079,7 +1080,7 @@
267 class sys_var_thd_storage_engine :public sys_var_thd
268 {
269 protected:
270-@@ -1466,3 +1540,10 @@
271+@@ -1466,3 +1542,10 @@
272 bool process_key_caches(process_key_cache_t func);
273 void delete_elements(I_List<NAMED_LIST> *list,
274 void (*free_element)(const char*, uchar*));
275@@ -1287,6 +1288,18 @@
276 /* <> 0 if we are inside of trigger or stored function. */
277 uint in_sub_stmt;
278 /* TRUE when the current top has SQL_LOG_BIN ON */
279+@@ -1777,6 +1817,11 @@
280+ create_sort_index(); may differ from examined_row_count.
281+ */
282+ ulong row_count;
283++ /*
284++ Original row_count value at the start of query execution
285++ (used by the slow_extended patch).
286++ */
287++ ulong orig_row_count;
288+ pthread_t real_id; /* For debugging */
289+ my_thread_id thread_id;
290+ uint tmp_table, global_read_lock;
291 diff -ruN a/sql/sql_connect.cc b/sql/sql_connect.cc
292 --- a/sql/sql_connect.cc 2010-08-04 02:24:34.000000000 +0900
293 +++ b/sql/sql_connect.cc 2010-08-27 14:30:34.905058444 +0900
294@@ -1362,16 +1375,17 @@
295 /*
296 Do not log administrative statements unless the appropriate option is
297 set.
298-@@ -2085,6 +2122,8 @@
299+@@ -2085,6 +2122,9 @@
300 context.resolve_in_table_list_only(select_lex->
301 table_list.first);
302
303-+ /* Reset the counter at all cases for the extended slow query log */
304-+ thd->row_count= 1;
305++ /* Save the original row_count value for extended stats in slow query log */
306++ thd->orig_row_count= thd->row_count;
307++
308 /*
309 Reset warning count for each query that uses tables
310 A better approach would be to reset this for any commands
311-@@ -5800,6 +5839,21 @@
312+@@ -5800,6 +5840,21 @@
313 thd->rand_used= 0;
314 thd->sent_row_count= thd->examined_row_count= 0;
315

Subscribers

People subscribed via source and target branches

to all changes: