Merge lp:~tsarev/percona-server/test55_830199 into lp:percona-server/5.5

Proposed by Oleg Tsarev
Status: Merged
Approved by: Oleg Tsarev
Approved revision: no longer in the source branch.
Merged at revision: 150
Proposed branch: lp:~tsarev/percona-server/test55_830199
Merge into: lp:percona-server/5.5
Diff against target: 80 lines (+41/-10)
1 file modified
patches/slow_extended.patch (+41/-10)
To merge this branch: bzr merge lp:~tsarev/percona-server/test55_830199
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Alexey Kopytov (community) Approve
Review via email: mp+76440@code.launchpad.net

This proposal supersedes a proposal from 2011-09-21.

Description of the change

Fix bug #830199 - thd->last_errno was not updated on handle_condition (bug was introduced while porting slow_extended.patch 5.1 to 5.5)

To post a comment you must log in.
Revision history for this message
Oleg Tsarev (tsarev) wrote : Posted in a previous version of this proposal
Revision history for this message
Oleg Tsarev (tsarev) wrote : Posted in a previous version of this proposal
Revision history for this message
Oleg Tsarev (tsarev) wrote : Posted in a previous version of this proposal
Revision history for this message
Alexey Kopytov (akopytov) wrote : Posted in a previous version of this proposal

Do you really need "SET GLOBAL long_query_time" in the test case? Setting only the session value seems to be enough.

review: Needs Fixing
Revision history for this message
Oleg Tsarev (tsarev) wrote :
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'patches/slow_extended.patch'
--- patches/slow_extended.patch 2011-09-21 08:35:45 +0000
+++ patches/slow_extended.patch 2011-09-21 16:21:23 +0000
@@ -549,15 +549,16 @@
549 549
550 /**550 /**
551 Dumps a text description of a thread, its security context551 Dumps a text description of a thread, its security context
552@@ -912,6 +943,7 @@552@@ -907,6 +938,8 @@
553 const char* msg,
554 MYSQL_ERROR ** cond_hdl)
555 {
556+ last_errno= sql_errno;
557+
558 if (!m_internal_handler)
559 {
553 *cond_hdl= NULL;560 *cond_hdl= NULL;
554 return FALSE;561@@ -3656,6 +3689,12 @@
555 }
556+ last_errno= sql_errno;
557
558 for (Internal_error_handler *error_handler= m_internal_handler;
559 error_handler;
560@@ -3656,6 +3688,12 @@
561 first_successful_insert_id_in_prev_stmt;562 first_successful_insert_id_in_prev_stmt;
562 backup->first_successful_insert_id_in_cur_stmt= 563 backup->first_successful_insert_id_in_cur_stmt=
563 first_successful_insert_id_in_cur_stmt;564 first_successful_insert_id_in_cur_stmt;
@@ -570,7 +571,7 @@
570 571
571 if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&572 if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&
572 !is_current_stmt_binlog_format_row())573 !is_current_stmt_binlog_format_row())
573@@ -3676,6 +3714,14 @@574@@ -3676,6 +3715,14 @@
574 cuted_fields= 0;575 cuted_fields= 0;
575 transaction.savepoints= 0;576 transaction.savepoints= 0;
576 first_successful_insert_id_in_cur_stmt= 0;577 first_successful_insert_id_in_cur_stmt= 0;
@@ -585,7 +586,7 @@
585 }586 }
586 587
587 588
588@@ -3738,6 +3784,12 @@589@@ -3738,6 +3785,12 @@
589 */590 */
590 examined_row_count+= backup->examined_row_count;591 examined_row_count+= backup->examined_row_count;
591 cuted_fields+= backup->cuted_fields;592 cuted_fields+= backup->cuted_fields;
@@ -2384,3 +2385,33 @@
2384+++ b/mysql-test/t/percona_log_slow_global_control_default.test2385+++ b/mysql-test/t/percona_log_slow_global_control_default.test
2385@@ -0,0 +1 @@2386@@ -0,0 +1 @@
2386+SET GLOBAL slow_query_log_use_global_control=default;2387+SET GLOBAL slow_query_log_use_global_control=default;
2388--- /dev/null
2389+++ b/mysql-test/r/percona_slow_extended_log_error.result
2390@@ -0,0 +1,9 @@
2391+SET long_query_time=0;
2392+DROP TABLE IF EXISTS t1;
2393+CREATE TABLE t(a INT);
2394+[log_start.inc] percona.slow_extended.log_error
2395+CREATE TABLE t(a INT);
2396+ERROR 42S01: Table 't' already exists
2397+[log_stop.inc] percona.slow_extended.log_error
2398+[log_grep.inc] file: percona.slow_extended.log_error pattern: Last_errno: 1050
2399+[log_grep.inc] lines: 1
2400--- /dev/null
2401+++ b/mysql-test/t/percona_slow_extended_log_error.test
2402@@ -0,0 +1,15 @@
2403+--let log_file=percona.slow_extended.log_error
2404+SET long_query_time=0;
2405+--disable_warnings
2406+DROP TABLE IF EXISTS t1;
2407+--enable_warnings
2408+CREATE TABLE t(a INT);
2409+--source include/log_start.inc
2410+
2411+--error ER_TABLE_EXISTS_ERROR
2412+CREATE TABLE t(a INT);
2413+
2414+--source include/log_stop.inc
2415+--let grep_pattern = Last_errno: 1050
2416+--source include/log_grep.inc
2417+DROP TABLE t;

Subscribers

People subscribed via source and target branches