mirror of
https://github.com/MariaDB/server.git
synced 2025-08-02 14:47:37 +03:00
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
This commit is contained in:
committed by
Michael Widenius
parent
39e6083e35
commit
9aac546872
@ -2686,6 +2686,9 @@ bool log_drop_table(THD *thd, const char *db_name, size_t db_name_length,
|
||||
bool error;
|
||||
DBUG_ENTER("log_drop_table");
|
||||
|
||||
if (!mysql_bin_log.is_open())
|
||||
DBUG_RETURN(0);
|
||||
|
||||
query.length(0);
|
||||
query.append(STRING_WITH_LEN("DROP "));
|
||||
if (temporary_table)
|
||||
@ -4759,11 +4762,10 @@ int create_table_impl(THD *thd,
|
||||
DBUG_EXECUTE_IF("send_kill_after_delete", thd->killed= KILL_QUERY; );
|
||||
|
||||
/*
|
||||
The test of query_tables is to ensure we have any tables in the
|
||||
select part
|
||||
Restart statement transactions for the case of CREATE ... SELECT.
|
||||
*/
|
||||
if (thd->lex->query_tables &&
|
||||
restart_trans_for_tables(thd, thd->lex->query_tables->next_global))
|
||||
if (thd->lex->select_lex.item_list.elements &&
|
||||
restart_trans_for_tables(thd, thd->lex->query_tables))
|
||||
goto err;
|
||||
}
|
||||
else if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
||||
|
Reference in New Issue
Block a user