Merge lp:~akopytov/percona-server/bug830286-5.1 into lp:percona-server/5.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: 495
Merged at revision: 503
Proposed branch: lp:~akopytov/percona-server/bug830286-5.1
Merge into: lp:percona-server/5.1
Diff against target: 163 lines (+80/-13)
6 files modified
Percona-Server/mysql-test/r/percona_bug830286.result (+15/-0)
Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result (+6/-6)
Percona-Server/mysql-test/t/percona_bug830286.test (+58/-0)
Percona-Server/sql/log.cc (+1/-1)
Percona-Server/sql/sql_class.cc (+0/-1)
Percona-Server/sql/sql_class.h (+0/-5)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug830286-5.1
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
George Ormond Lorch III g2 Approve
Vlad Lesin (community) Approve
Review via email: mp+131720@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

Looks good.

review: Approve
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Comment typo at diff line 78: s/= 0;/= 1;/

Can you repush the branch with it fixed? No need to resubmit, retest, etc.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'Percona-Server/mysql-test/r/percona_bug830286.result'
--- Percona-Server/mysql-test/r/percona_bug830286.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/r/percona_bug830286.result 2012-10-27 06:45:26 +0000
@@ -0,0 +1,15 @@
1SET @old_slow_query_log_file=@@global.slow_query_log_file;
2SET GLOBAL slow_query_log=ON;
3SET LOCAL long_query_time=0;
4SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug830286_slow.log';;
5CREATE TABLE t1(a INT);
6INSERT INTO t1 VALUES (1), (2), (3), (4);
7SELECT * FROM t1 LIMIT 1;
8a
91
10Rows_read: 0
11Rows_read: 0
12Rows_read: 0
13Rows_read: 1
14SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
15DROP TABLE t1;
016
=== modified file 'Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result'
--- Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result 2011-11-24 01:59:42 +0000
+++ Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result 2012-10-27 06:45:26 +0000
@@ -33,9 +33,9 @@
33[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 033[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0
34[log_grep.inc] lines: 334[log_grep.inc] lines: 3
35[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+35[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+
36[log_grep.inc] lines: 336[log_grep.inc] lines: 0
37[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 037[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0
38[log_grep.inc] lines: 038[log_grep.inc] lines: 3
39[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+39[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+
40[log_grep.inc] lines: 240[log_grep.inc] lines: 2
41[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 041[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0
@@ -89,9 +89,9 @@
89[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 089[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0
90[log_grep.inc] lines: 190[log_grep.inc] lines: 1
91[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+91[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+
92[log_grep.inc] lines: 392[log_grep.inc] lines: 1
93[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 093[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0
94[log_grep.inc] lines: 094[log_grep.inc] lines: 2
95[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+95[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+
96[log_grep.inc] lines: 296[log_grep.inc] lines: 2
97[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 097[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0
@@ -145,9 +145,9 @@
145[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0145[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0
146[log_grep.inc] lines: 3146[log_grep.inc] lines: 3
147[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+147[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+
148[log_grep.inc] lines: 3148[log_grep.inc] lines: 1
149[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0149[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0
150[log_grep.inc] lines: 0150[log_grep.inc] lines: 2
151[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+151[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+
152[log_grep.inc] lines: 2152[log_grep.inc] lines: 2
153[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0153[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0
154154
=== added file 'Percona-Server/mysql-test/t/percona_bug830286.test'
--- Percona-Server/mysql-test/t/percona_bug830286.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/t/percona_bug830286.test 2012-10-27 06:45:26 +0000
@@ -0,0 +1,58 @@
1#########################################################################
2# LP bug #830286: rows_read is overflowed when changing db
3#########################################################################
4
5#
6# This test suffers from server
7# Bug#38124 "general_log_file" variable silently unset when using expression
8# In short:
9# SET GLOBAL general_log_file = @<whatever>
10# SET GLOBAL slow_query_log = @<whatever>
11# cause that the value of these server system variables is set to default
12# instead of the assigned values. There comes no error message or warning.
13# If this bug is fixed please
14# 1. try this test with "let $fixed_bug38124 = 0;"
15# 2. remove all workarounds if 1. was successful.
16let $fixed_bug38124 = 0;
17
18SET @old_slow_query_log_file=@@global.slow_query_log_file;
19SET GLOBAL slow_query_log=ON;
20SET LOCAL long_query_time=0;
21
22let slogfile=$MYSQLTEST_VARDIR/percona_bug830286_slow.log;
23--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
24--eval SET GLOBAL slow_query_log_file='$slogfile';
25
26--disable_ps_protocol
27CREATE TABLE t1(a INT);
28INSERT INTO t1 VALUES (1), (2), (3), (4);
29SELECT * FROM t1 LIMIT 1;
30--enable_ps_protocol
31
32perl;
33 $slogfile= $ENV{'slogfile'};
34
35 open(FILE, "$slogfile") or
36 die("Unable to read slow query log file $slogfile: $!\n");
37 while(<FILE>) {
38 next if (!/^# Query_time:/);
39 s/.*(Rows_read: [0-9]+)/$1/g;
40 print;
41 }
42
43 close(FILE);
44 open(FILE, '>', "$slogfile");
45 close(FILE);
46EOF
47
48SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
49
50DROP TABLE t1;
51
52if(!$fixed_bug38124)
53{
54 --disable_query_log
55 let $my_var = `SELECT @old_slow_query_log_file`;
56 eval SET @@global.slow_query_log_file = '$my_var';
57 --enable_query_log
58}
059
=== modified file 'Percona-Server/sql/log.cc'
--- Percona-Server/sql/log.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/log.cc 2012-10-27 06:45:26 +0000
@@ -2418,7 +2418,7 @@
2418 (ulong) thd->sent_row_count,2418 (ulong) thd->sent_row_count,
2419 (ulong) thd->examined_row_count,2419 (ulong) thd->examined_row_count,
2420 ((long) thd->row_count_func > 0 ) ? (ulong) thd->row_count_func : 0,2420 ((long) thd->row_count_func > 0 ) ? (ulong) thd->row_count_func : 0,
2421 thd->row_count - thd->orig_row_count + 1,2421 (ulong) thd->examined_row_count,
2422 (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old),2422 (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old),
2423 (ulong) thd->tmp_tables_used,2423 (ulong) thd->tmp_tables_used,
2424 (ulong) thd->tmp_tables_disk_used,2424 (ulong) thd->tmp_tables_disk_used,
24252425
=== modified file 'Percona-Server/sql/sql_class.cc'
--- Percona-Server/sql/sql_class.cc 2012-08-20 05:18:21 +0000
+++ Percona-Server/sql/sql_class.cc 2012-10-27 06:45:26 +0000
@@ -3406,7 +3406,6 @@
3406{3406{
3407 DBUG_ENTER("THD::clear_slow_extended");3407 DBUG_ENTER("THD::clear_slow_extended");
3408 sent_row_count= 0;3408 sent_row_count= 0;
3409 orig_row_count= row_count;
3410 examined_row_count= 0;3409 examined_row_count= 0;
3411 bytes_sent_old= status_var.bytes_sent;3410 bytes_sent_old= status_var.bytes_sent;
3412 tmp_tables_used= 0;3411 tmp_tables_used= 0;
34133412
=== modified file 'Percona-Server/sql/sql_class.h'
--- Percona-Server/sql/sql_class.h 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/sql_class.h 2012-10-27 06:45:26 +0000
@@ -1514,11 +1514,6 @@
1514 */1514 */
1515 ulonglong bytes_sent_old;1515 ulonglong bytes_sent_old;
1516 /*1516 /*
1517 Original row_count value at the start of query execution
1518 (used by the slow_extended patch).
1519 */
1520 ulong orig_row_count;
1521 /*
1522 Variables tmp_tables_*** collect statistics about usage of temporary tables1517 Variables tmp_tables_*** collect statistics about usage of temporary tables
1523 */1518 */
1524 ulong tmp_tables_used;1519 ulong tmp_tables_used;

Subscribers

People subscribed via source and target branches