summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2014-03-23 18:39:10 +0200
committerMichael Widenius <monty@askmonty.org>2014-03-23 18:39:10 +0200
commit9aac54687286b979c9469326f501a4b23aa5e4a3 (patch)
treedc701d68c87d99f06c1ef348cdad92c6b42df0fa /sql/sql_insert.cc
parent39e6083e35459c9c8b22d37aaa2b74545884c7b0 (diff)
downloadmariadb-git-9aac54687286b979c9469326f501a4b23aa5e4a3.tar.gz
MDEV-5930 Server crashes in thd_get_ha_data on CREATE OR REPLACE TABLE
mysql-test/r/create_or_replace.result: More tests for create or replace mysql-test/t/create_or_replace.test: More tests for create or replace sql/log.cc: Don't use binlog_hton if binlog is not enabmed sql/sql_base.cc: We have to call restart_trans_for_tables also if tables where not locked with LOCK TABLES. If not, we will get a crash in TokuDB sql/sql_insert.cc: Don't call binlog_reset_cache() if we don't have binary log open sql/sql_table.cc: Don't log to binary log if not open Better test if we where using create or replace ... select storage/tokudb/mysql-test/tokudb_mariadb/r/create_or_replace.result: More tests for create or replace storage/tokudb/mysql-test/tokudb_mariadb/t/create_or_replace.test: More tests for create or replace
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index bf512fef67d..59223a6091f 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4302,7 +4302,7 @@ void select_create::abort_result_set()
table->auto_increment_field_not_null= FALSE;
drop_open_table(thd, table, create_table->db, create_table->table_name);
table=0; // Safety
- if (thd->log_current_statement)
+ if (thd->log_current_statement && mysql_bin_log.is_open())
{
/* Remove logging of drop, create + insert rows */
binlog_reset_cache(thd);
@@ -4314,4 +4314,3 @@ void select_create::abort_result_set()
}
DBUG_VOID_RETURN;
}
-