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

Proposed by Alexey Kopytov on 2012-10-27
Status: Merged
Approved by: Laurynas Biveinis on 2012-11-29
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 on 2012-11-29
George Ormond Lorch III g2 Approve on 2012-11-27
Vlad Lesin (community) 2012-10-27 Approve on 2012-11-21
Review via email: mp+131720@code.launchpad.net
To post a comment you must log in.
Vlad Lesin (vlad-lesin) wrote :

Looks good.

review: Approve
review: Approve (g2)

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
1=== added file 'Percona-Server/mysql-test/r/percona_bug830286.result'
2--- Percona-Server/mysql-test/r/percona_bug830286.result 1970-01-01 00:00:00 +0000
3+++ Percona-Server/mysql-test/r/percona_bug830286.result 2012-10-27 06:45:26 +0000
4@@ -0,0 +1,15 @@
5+SET @old_slow_query_log_file=@@global.slow_query_log_file;
6+SET GLOBAL slow_query_log=ON;
7+SET LOCAL long_query_time=0;
8+SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug830286_slow.log';;
9+CREATE TABLE t1(a INT);
10+INSERT INTO t1 VALUES (1), (2), (3), (4);
11+SELECT * FROM t1 LIMIT 1;
12+a
13+1
14+Rows_read: 0
15+Rows_read: 0
16+Rows_read: 0
17+Rows_read: 1
18+SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
19+DROP TABLE t1;
20
21=== modified file 'Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result'
22--- Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result 2011-11-24 01:59:42 +0000
23+++ Percona-Server/mysql-test/r/percona_slow_extended_error_on_quit.result 2012-10-27 06:45:26 +0000
24@@ -33,9 +33,9 @@
25 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0
26 [log_grep.inc] lines: 3
27 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+
28-[log_grep.inc] lines: 3
29+[log_grep.inc] lines: 0
30 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0
31-[log_grep.inc] lines: 0
32+[log_grep.inc] lines: 3
33 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+
34 [log_grep.inc] lines: 2
35 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0
36@@ -89,9 +89,9 @@
37 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0
38 [log_grep.inc] lines: 1
39 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+
40-[log_grep.inc] lines: 3
41+[log_grep.inc] lines: 1
42 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0
43-[log_grep.inc] lines: 0
44+[log_grep.inc] lines: 2
45 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+
46 [log_grep.inc] lines: 2
47 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0
48@@ -145,9 +145,9 @@
49 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_affected: 0
50 [log_grep.inc] lines: 3
51 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: [^0]+
52-[log_grep.inc] lines: 3
53+[log_grep.inc] lines: 1
54 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Rows_read: 0
55-[log_grep.inc] lines: 0
56+[log_grep.inc] lines: 2
57 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: [^0]+
58 [log_grep.inc] lines: 2
59 [log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Bytes_sent: 0
60
61=== added file 'Percona-Server/mysql-test/t/percona_bug830286.test'
62--- Percona-Server/mysql-test/t/percona_bug830286.test 1970-01-01 00:00:00 +0000
63+++ Percona-Server/mysql-test/t/percona_bug830286.test 2012-10-27 06:45:26 +0000
64@@ -0,0 +1,58 @@
65+#########################################################################
66+# LP bug #830286: rows_read is overflowed when changing db
67+#########################################################################
68+
69+#
70+# This test suffers from server
71+# Bug#38124 "general_log_file" variable silently unset when using expression
72+# In short:
73+# SET GLOBAL general_log_file = @<whatever>
74+# SET GLOBAL slow_query_log = @<whatever>
75+# cause that the value of these server system variables is set to default
76+# instead of the assigned values. There comes no error message or warning.
77+# If this bug is fixed please
78+# 1. try this test with "let $fixed_bug38124 = 0;"
79+# 2. remove all workarounds if 1. was successful.
80+let $fixed_bug38124 = 0;
81+
82+SET @old_slow_query_log_file=@@global.slow_query_log_file;
83+SET GLOBAL slow_query_log=ON;
84+SET LOCAL long_query_time=0;
85+
86+let slogfile=$MYSQLTEST_VARDIR/percona_bug830286_slow.log;
87+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
88+--eval SET GLOBAL slow_query_log_file='$slogfile';
89+
90+--disable_ps_protocol
91+CREATE TABLE t1(a INT);
92+INSERT INTO t1 VALUES (1), (2), (3), (4);
93+SELECT * FROM t1 LIMIT 1;
94+--enable_ps_protocol
95+
96+perl;
97+ $slogfile= $ENV{'slogfile'};
98+
99+ open(FILE, "$slogfile") or
100+ die("Unable to read slow query log file $slogfile: $!\n");
101+ while(<FILE>) {
102+ next if (!/^# Query_time:/);
103+ s/.*(Rows_read: [0-9]+)/$1/g;
104+ print;
105+ }
106+
107+ close(FILE);
108+ open(FILE, '>', "$slogfile");
109+ close(FILE);
110+EOF
111+
112+SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
113+
114+DROP TABLE t1;
115+
116+if(!$fixed_bug38124)
117+{
118+ --disable_query_log
119+ let $my_var = `SELECT @old_slow_query_log_file`;
120+ eval SET @@global.slow_query_log_file = '$my_var';
121+ --enable_query_log
122+}
123
124=== modified file 'Percona-Server/sql/log.cc'
125--- Percona-Server/sql/log.cc 2012-08-20 03:14:02 +0000
126+++ Percona-Server/sql/log.cc 2012-10-27 06:45:26 +0000
127@@ -2418,7 +2418,7 @@
128 (ulong) thd->sent_row_count,
129 (ulong) thd->examined_row_count,
130 ((long) thd->row_count_func > 0 ) ? (ulong) thd->row_count_func : 0,
131- thd->row_count - thd->orig_row_count + 1,
132+ (ulong) thd->examined_row_count,
133 (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old),
134 (ulong) thd->tmp_tables_used,
135 (ulong) thd->tmp_tables_disk_used,
136
137=== modified file 'Percona-Server/sql/sql_class.cc'
138--- Percona-Server/sql/sql_class.cc 2012-08-20 05:18:21 +0000
139+++ Percona-Server/sql/sql_class.cc 2012-10-27 06:45:26 +0000
140@@ -3406,7 +3406,6 @@
141 {
142 DBUG_ENTER("THD::clear_slow_extended");
143 sent_row_count= 0;
144- orig_row_count= row_count;
145 examined_row_count= 0;
146 bytes_sent_old= status_var.bytes_sent;
147 tmp_tables_used= 0;
148
149=== modified file 'Percona-Server/sql/sql_class.h'
150--- Percona-Server/sql/sql_class.h 2012-08-20 03:14:02 +0000
151+++ Percona-Server/sql/sql_class.h 2012-10-27 06:45:26 +0000
152@@ -1514,11 +1514,6 @@
153 */
154 ulonglong bytes_sent_old;
155 /*
156- Original row_count value at the start of query execution
157- (used by the slow_extended patch).
158- */
159- ulong orig_row_count;
160- /*
161 Variables tmp_tables_*** collect statistics about usage of temporary tables
162 */
163 ulong tmp_tables_used;

Subscribers

People subscribed via source and target branches