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
=== modified file 'patches/slow_extended.patch'
--- patches/slow_extended.patch 2011-08-09 13:35:34 +0000
+++ patches/slow_extended.patch 2011-09-06 08:42:23 +0000
@@ -1388,7 +1388,15 @@
1388 1388
1389 const char *any_db="*any*"; // Special symbol for check_access1389 const char *any_db="*any*"; // Special symbol for check_access
1390 1390
1391@@ -1700,6 +1701,50 @@1391@@ -999,6 +1000,7 @@
1392 the slow log only if opt_log_slow_admin_statements is set.
1393 */
1394 thd->enable_slow_log= TRUE;
1395+ thd->last_errno= 0;
1396 thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
1397 thd->set_time();
1398 if (!thd->is_valid_time())
1399@@ -1700,6 +1702,50 @@
1392 DBUG_RETURN(error);1400 DBUG_RETURN(error);
1393 }1401 }
1394 1402
@@ -1439,7 +1447,7 @@
1439 1447
1440 void log_slow_statement(THD *thd)1448 void log_slow_statement(THD *thd)
1441 {1449 {
1442@@ -1713,17 +1758,51 @@1450@@ -1713,17 +1759,51 @@
1443 if (unlikely(thd->in_sub_stmt))1451 if (unlikely(thd->in_sub_stmt))
1444 DBUG_VOID_RETURN; // Don't set time for sub stmt1452 DBUG_VOID_RETURN; // Don't set time for sub stmt
1445 1453
@@ -1494,7 +1502,7 @@
1494 ((thd->server_status &1502 ((thd->server_status &
1495 (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&1503 (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
1496 opt_log_queries_not_using_indexes &&1504 opt_log_queries_not_using_indexes &&
1497@@ -2099,6 +2178,9 @@1505@@ -2099,6 +2179,9 @@
1498 context.resolve_in_table_list_only(select_lex->1506 context.resolve_in_table_list_only(select_lex->
1499 table_list.first);1507 table_list.first);
1500 1508
@@ -1504,7 +1512,7 @@
1504 /*1512 /*
1505 Reset warning count for each query that uses tables1513 Reset warning count for each query that uses tables
1506 A better approach would be to reset this for any commands1514 A better approach would be to reset this for any commands
1507@@ -5827,6 +5909,21 @@1515@@ -5827,6 +5910,21 @@
1508 thd->rand_used= 0;1516 thd->rand_used= 0;
1509 thd->sent_row_count= thd->examined_row_count= 0;1517 thd->sent_row_count= thd->examined_row_count= 0;
1510 1518
@@ -2575,3 +2583,44 @@
2575 /* Intvar event post-header */2583 /* Intvar event post-header */
2576 2584
2577 /* Intvar event data */2585 /* Intvar event data */
2586--- /dev/null
2587+++ b/mysql-test/r/percona_log_slow_parse_error.result
2588@@ -0,0 +1,11 @@
2589+SET GLOBAL long_query_time=0;
2590+SET GLOBAL use_global_long_query_time=1;
2591+SET GLOBAL log_slow_timestamp_every=1;
2592+DROP TABLE IF EXISTS t1;
2593+CREATE TABLE t1 (a INT);
2594+[log_start.inc] percona.slow_extended.error_on_quit
2595+CREATE TABLE t1 (a INT);
2596+ERROR 42S01: Table 't1' already exists
2597+[log_stop.inc] percona.slow_extended.error_on_quit
2598+[log_grep.inc] file: percona.slow_extended.error_on_quit pattern: Last_errno: 1050
2599+[log_grep.inc] lines: 1
2600--- /dev/null
2601+++ b/mysql-test/t/percona_log_slow_parse_error.test
2602@@ -0,0 +1,24 @@
2603+--let log_file=percona.slow_extended.error_on_quit
2604+
2605+SET GLOBAL long_query_time=0;
2606+SET GLOBAL use_global_long_query_time=1;
2607+SET GLOBAL log_slow_timestamp_every=1;
2608+
2609+connect (conn1,localhost,root,,);
2610+connection conn1;
2611+--disable_warnings
2612+DROP TABLE IF EXISTS t1;
2613+--enable_warnings
2614+CREATE TABLE t1 (a INT);
2615+--source include/log_start.inc
2616+--error 1050
2617+CREATE TABLE t1 (a INT);
2618+disconnect conn1;
2619+connection default;
2620+--source include/log_stop.inc
2621+--let grep_pattern = Last_errno: 1050
2622+--source include/log_grep.inc
2623+SET GLOBAL long_query_time=default;
2624+SET GLOBAL use_global_long_query_time=default;
2625+SET GLOBAL log_slow_timestamp_every=default;
2626+DROP TABLE t1;

Subscribers

People subscribed via source and target branches