summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2009-01-28 14:35:12 +0000
committerAlfranio Correia <alfranio.correia@sun.com>2009-01-28 14:35:12 +0000
commit23d032c34eeb4c7af02fbc96de215d01a9004522 (patch)
tree040225df6c08810585acab2c2463e4dea3bbd2bb /sql/sql_table.cc
parent34dabc062f19c87fd2d85bc62b157ed31899e17e (diff)
downloadmariadb-git-23d032c34eeb4c7af02fbc96de215d01a9004522.tar.gz
BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used
When using CREATE TEMPORARY TABLE LIKE to create a temporary table, or using TRUNCATE to delete all rows of a temporary table, they did not set the tmp_table_used flag, and cause the omission of "SET @@session.pseudo_thread_id" when dumping binlog with mysqlbinlog, and cause error when replay the statements. This patch fixed the problem by setting tmp_table_used in these two cases. (Done by He Zhenxing 2009-01-12) mysql-test/suite/binlog/r/binlog_tmp_table.result: Add test case for BUG#35583 mysql-test/suite/binlog/t/binlog_tmp_table.test: Add test case for BUG#35583 sql/sql_delete.cc: set thd->tmp_table_used when truncate temporary table sql/sql_table.cc: set thd->tmp_table_used when using create like to create temporary tables
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 3ec03be72a5..4827810334f 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4983,6 +4983,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
dst_path); /* purecov: inspected */
goto err; /* purecov: inspected */
}
+ thd->thread_specific_used= TRUE;
}
else if (err)
{