Merge lp:~tsarev/percona-server/test51_716210 into lp:percona-server/5.1

Proposed by Oleg Tsarev
Status: Superseded
Proposed branch: lp:~tsarev/percona-server/test51_716210
Merge into: lp:percona-server/5.1
Diff against target: 92 lines (+53/-4)
1 file modified
patches/slow_extended.patch (+53/-4)
To merge this branch: bzr merge lp:~tsarev/percona-server/test51_716210
Reviewer Review Type Date Requested Status
Percona developers Pending
Review via email: mp+74178@code.launchpad.net

This proposal has been superseded by a proposal from 2011-09-12.

Description of the change

Fixed bug #716210 - incorrect last_errno in slow-query-log

To post a comment you must log in.
Revision history for this message
Oleg Tsarev (tsarev) wrote :
281. By Oleg Tsarev

1) move tests from mysql-test/ to patches
2) remove install_tests script and call of script from Makefile

282. By Oleg Tsarev

Fixed bug #716210 - incorrect last_errno in slow-query-log

Unmerged revisions

282. By Oleg Tsarev

Fixed bug #716210 - incorrect last_errno in slow-query-log

281. By Oleg Tsarev

1) move tests from mysql-test/ to patches
2) remove install_tests script and call of script from Makefile

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/slow_extended.patch'
2--- patches/slow_extended.patch 2011-08-09 13:35:34 +0000
3+++ patches/slow_extended.patch 2011-09-06 08:42:23 +0000
4@@ -1388,7 +1388,15 @@
5
6 const char *any_db="*any*"; // Special symbol for check_access
7
8-@@ -1700,6 +1701,50 @@
9+@@ -999,6 +1000,7 @@
10+ the slow log only if opt_log_slow_admin_statements is set.
11+ */
12+ thd->enable_slow_log= TRUE;
13++ thd->last_errno= 0;
14+ thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
15+ thd->set_time();
16+ if (!thd->is_valid_time())
17+@@ -1700,6 +1702,50 @@
18 DBUG_RETURN(error);
19 }
20
21@@ -1439,7 +1447,7 @@
22
23 void log_slow_statement(THD *thd)
24 {
25-@@ -1713,17 +1758,51 @@
26+@@ -1713,17 +1759,51 @@
27 if (unlikely(thd->in_sub_stmt))
28 DBUG_VOID_RETURN; // Don't set time for sub stmt
29
30@@ -1494,7 +1502,7 @@
31 ((thd->server_status &
32 (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
33 opt_log_queries_not_using_indexes &&
34-@@ -2099,6 +2178,9 @@
35+@@ -2099,6 +2179,9 @@
36 context.resolve_in_table_list_only(select_lex->
37 table_list.first);
38
39@@ -1504,7 +1512,7 @@
40 /*
41 Reset warning count for each query that uses tables
42 A better approach would be to reset this for any commands
43-@@ -5827,6 +5909,21 @@
44+@@ -5827,6 +5910,21 @@
45 thd->rand_used= 0;
46 thd->sent_row_count= thd->examined_row_count= 0;
47
48@@ -2575,3 +2583,44 @@
49 /* Intvar event post-header */
50
51 /* Intvar event data */
52+--- /dev/null
53++++ b/mysql-test/r/percona_log_slow_parse_error.result
54+@@ -0,0 +1,11 @@
55++SET GLOBAL long_query_time=0;
56++SET GLOBAL use_global_long_query_time=1;
57++SET GLOBAL log_slow_timestamp_every=1;
58++DROP TABLE IF EXISTS t1;
59++CREATE TABLE t1 (a INT);
60++[log_start.inc] percona.slow_extended.error_on_quit
61++CREATE TABLE t1 (a INT);
62++ERROR 42S01: Table 't1' already exists
63++[log_stop.inc] percona.slow_extended.error_on_quit
64++[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: 1050
65++[log_grep.inc] lines: 1
66+--- /dev/null
67++++ b/mysql-test/t/percona_log_slow_parse_error.test
68+@@ -0,0 +1,24 @@
69++--let log_file=percona.slow_extended.error_on_quit
70++
71++SET GLOBAL long_query_time=0;
72++SET GLOBAL use_global_long_query_time=1;
73++SET GLOBAL log_slow_timestamp_every=1;
74++
75++connect (conn1,localhost,root,,);
76++connection conn1;
77++--disable_warnings
78++DROP TABLE IF EXISTS t1;
79++--enable_warnings
80++CREATE TABLE t1 (a INT);
81++--source include/log_start.inc
82++--error 1050
83++CREATE TABLE t1 (a INT);
84++disconnect conn1;
85++connection default;
86++--source include/log_stop.inc
87++--let grep_pattern = Last_errno: 1050
88++--source include/log_grep.inc
89++SET GLOBAL long_query_time=default;
90++SET GLOBAL use_global_long_query_time=default;
91++SET GLOBAL log_slow_timestamp_every=default;
92++DROP TABLE t1;

Subscribers

People subscribed via source and target branches