summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <guilhem@gbichot4.local>2007-08-08 17:07:12 +0200
committerunknown <guilhem@gbichot4.local>2007-08-08 17:07:12 +0200
commit711a820133c1143131ac2ae179c60570aa45f360 (patch)
treea51dde4f12041cae8c1cd7778a05c8fa4d363c2b
parent62b30a1922f12f098043d76336466c89ea37e7bd (diff)
downloadmariadb-git-711a820133c1143131ac2ae179c60570aa45f360.tar.gz
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"
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/sql_delete.cc13
2 files changed, 13 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 57d8a89a3c1..dec25215acc 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -770,6 +770,7 @@ static void close_connections(void)
DBUG_PRINT("info",("Waiting for select thread"));
#ifndef DONT_USE_THR_ALARM
+ if (pthread_kill(select_thread, thr_client_alarm))
break; // allready dead
#endif
set_timespec(abstime, 2);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 7c868092921..c96ae8f2597 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -921,7 +921,18 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
goto trunc_by_del;
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
ha_create_table(thd, share->normalized_path.str,
share->db.str, share->table_name.str, &create_info, 1);