summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-13 11:37:01 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-13 13:32:27 +0300
commitf25e9aa4ba9c7d3a4fbeaa280d2bb39abe023e80 (patch)
treec0ba41146e97a8cb6b61a509a2bbc77f7586d88b /sql/sql_table.cc
parent5edc4ea4d968e81408ab9e343a0b3940797f98fc (diff)
downloadmariadb-git-f25e9aa4ba9c7d3a4fbeaa280d2bb39abe023e80.tar.gz
MDEV-20310: Make InnoDB crash tests Valgrind-friendly
Use DEBUG_SYNC to hang the execution at the interesting point, and then kill and restart the server externally. This will work also with Valgrind. DBUG_SUICIDE() causes Valgrind to hang, and it could also cause uninteresting reports about memory leaks. While we are at it, let us clean up innodb.innodb_bulk_create_index_debug so that it will actually test the desired functionality also in future versions (with instant ADD COLUMN and DROP COLUMN) and avoid some unnecessary restarts. We are adding two DEBUG_SYNC points for ALTER TABLE, because there were none that would be executed right before ha_commit_trans().
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 41f62de2a70..9d7e03727d3 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -9788,6 +9788,7 @@ end_temporary:
(ulong) (copied + deleted), (ulong) deleted,
(ulong) thd->get_stmt_da()->current_statement_warn_count());
my_ok(thd, copied + deleted, 0L, alter_ctx.tmp_name);
+ DEBUG_SYNC(thd, "alter_table_inplace_trans_commit");
DBUG_RETURN(false);
err_new_table_cleanup:
@@ -9889,12 +9890,14 @@ bool mysql_trans_commit_alter_copy_data(THD *thd)
uint save_unsafe_rollback_flags;
DBUG_ENTER("mysql_trans_commit_alter_copy_data");
- /* Save flags as transcommit_implicit_are_deleting_them */
+ /* Save flags as trans_commit_implicit are deleting them */
save_unsafe_rollback_flags= thd->transaction.stmt.m_unsafe_rollback_flags;
+ DEBUG_SYNC(thd, "alter_table_copy_trans_commit");
+
if (ha_enable_transaction(thd, TRUE))
DBUG_RETURN(TRUE);
-
+
/*
Ensure that the new table is saved properly to disk before installing
the new .frm.