Commit 711a8201 authored by unknown's avatar unknown

Hackish fix for at-shutdown assertions in

./mtr --mysqld=--default-storage-engine=maria --mem --skip-ndb temp_table truncate --force
The root cause of the problem has been reported as BUG#30309
"mysql_truncate() does not inform engine that the recreated table is temporary"
The temporary fix used here is that when mysql_truncate() identifies
a temp table of engine "Maria" it declares it non-transactional,
thus the table is re-created by ha_maria::create() as non-transactional.


sql/mysqld.cc:
  porting fix of BUG#29133 (mysqld takes too much time to shutdown
  without this fix, I can't wait for the next merge)
sql/sql_delete.cc:
  a hack to work around BUG#30309 "mysql_truncate() does not inform
  engine that the recreated table is temporary"
parent 62b30a19
...@@ -770,6 +770,7 @@ static void close_connections(void) ...@@ -770,6 +770,7 @@ static void close_connections(void)
DBUG_PRINT("info",("Waiting for select thread")); DBUG_PRINT("info",("Waiting for select thread"));
#ifndef DONT_USE_THR_ALARM #ifndef DONT_USE_THR_ALARM
if (pthread_kill(select_thread, thr_client_alarm))
break; // allready dead break; // allready dead
#endif #endif
set_timespec(abstime, 2); set_timespec(abstime, 2);
......
...@@ -922,6 +922,17 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) ...@@ -922,6 +922,17 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK); table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
#ifdef WITH_MARIA_STORAGE_ENGINE
/*
A hack until BUG#30309 is fixed.
Had to make this, otherwise tests "temp_table.test" and "truncate.test"
crashes server at shutdown when using Maria tables: a temporary table is
correctly created as non-transactional but then, when truncated, is
recreated as transactional.
*/
if (table_type->db_type == DB_TYPE_MARIA)
create_info.transactional= HA_CHOICE_NO;
#endif
close_temporary_table(thd, table, 0, 0); // Don't free share close_temporary_table(thd, table, 0, 0); // Don't free share
ha_create_table(thd, share->normalized_path.str, ha_create_table(thd, share->normalized_path.str,
share->db.str, share->table_name.str, &create_info, 1); share->db.str, share->table_name.str, &create_info, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment