Skip to content

Commit bbc19d4

Browse files
author
Guilhem Bichot
committed
Fix for
Bug #13688248 CRASH IN DIAGNOSTICS_AREA::SET_OK_STATUS WHEN USING DEBUG_SYNC. And, to test the above, I had to fix Bug #13688015 THE OPTION --LOOSE-DEBUG-SYNC-TIMEOUT IS PLACED WRONG
1 parent 9f51fd2 commit bbc19d4

5 files changed

Lines changed: 51 additions & 5 deletions

File tree

mysql-test/mysql-test-run.pl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4865,6 +4865,14 @@ ($$$)
48654865
mtr_add_arg($args, "--gdb");
48664866
}
48674867

4868+
# Enable the debug sync facility, set default wait timeout.
4869+
# Facility stays disabled if timeout value is zero.
4870+
mtr_add_arg($args, "--loose-debug-sync-timeout=%s",
4871+
$opt_debug_sync_timeout) unless $opt_user_args;
4872+
4873+
# Options specified in .opt files should be added last so they can
4874+
# override defaults above.
4875+
48684876
my $found_skip_core= 0;
48694877
foreach my $arg ( @$extra_opts )
48704878
{
@@ -4901,11 +4909,6 @@ ($$$)
49014909
mtr_add_arg($args, "%s", "--core-file");
49024910
}
49034911

4904-
# Enable the debug sync facility, set default wait timeout.
4905-
# Facility stays disabled if timeout value is zero.
4906-
mtr_add_arg($args, "--loose-debug-sync-timeout=%s",
4907-
$opt_debug_sync_timeout) unless $opt_user_args;
4908-
49094912
return $args;
49104913
}
49114914

mysql-test/r/debug_sync2.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Bug#13688248 CRASH IN DIAGNOSTICS_AREA::SET_OK_STATUS WHEN USING DEBUG_SYNC
3+
#
4+
SET SESSION DEBUG_SYNC= 'RESET';
5+
CREATE TABLE t1 (pk INT, PRIMARY KEY(pk));
6+
SET SESSION sql_mode=TRADITIONAL;
7+
SET SESSION autocommit=1;
8+
INSERT INTO t1 VALUES(1);
9+
SET SESSION debug_sync='write_row_replace SIGNAL go_ahead1 WAIT_FOR comes_never ';
10+
REPLACE INTO t1 ( pk ) VALUES ( 1 );
11+
Warnings:
12+
Warning 1639 debug sync point wait timed out
13+
DROP TABLE t1;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--loose-debug-sync-timeout=1

mysql-test/t/debug_sync2.test

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--source include/have_innodb.inc
2+
--source include/have_debug_sync.inc
3+
4+
--echo #
5+
--echo # Bug#13688248 CRASH IN DIAGNOSTICS_AREA::SET_OK_STATUS WHEN USING DEBUG_SYNC
6+
--echo #
7+
8+
SET SESSION DEBUG_SYNC= 'RESET';
9+
10+
CREATE TABLE t1 (pk INT, PRIMARY KEY(pk));
11+
12+
connect (con1,localhost,root,,);
13+
connection con1;
14+
SET SESSION sql_mode=TRADITIONAL;
15+
SET SESSION autocommit=1;
16+
17+
INSERT INTO t1 VALUES(1);
18+
19+
connection con1;
20+
SET SESSION debug_sync='write_row_replace SIGNAL go_ahead1 WAIT_FOR comes_never ';
21+
--send
22+
REPLACE INTO t1 ( pk ) VALUES ( 1 );
23+
--reap;
24+
25+
DROP TABLE t1;

sql/debug_sync.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,8 +1788,12 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
17881788
sig_wait, sig_glob, error));});
17891789
if (error == ETIMEDOUT || error == ETIME)
17901790
{
1791+
// We should not make the statement fail, even if in strict mode.
1792+
const bool save_abort_on_warning= thd->abort_on_warning;
1793+
thd->abort_on_warning= false;
17911794
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
17921795
ER_DEBUG_SYNC_TIMEOUT, ER(ER_DEBUG_SYNC_TIMEOUT));
1796+
thd->abort_on_warning= save_abort_on_warning;
17931797
break;
17941798
}
17951799
error= 0;

0 commit comments

Comments
 (0)