1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#6883: Added tests for create/drop temporary table, UNLOCK TABLES

If a create table can not do implicit commit, the stmt now fails
CREATE/DROP TEMPORARY TABLE is now flushed to binlog
This commit is contained in:
lars@mysql.com
2005-06-01 15:52:32 +02:00
parent 54bf811ada
commit 2b3c8b9dc5
4 changed files with 1018 additions and 637 deletions

View File

@ -2410,10 +2410,19 @@ mysql_execute_command(THD *thd)
case SQLCOM_CREATE_TABLE:
{
/* If CREATE TABLE of non-temporary table, do implicit commit */
if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) &&
end_active_trans(thd))
res= -1;
if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
{
if (end_active_trans(thd))
{
res= -1;
break;
}
}
else
{
/* So that CREATE TEMPORARY TABLE gets flushed to binlog */
thd->options|= (OPTION_STATUS_NO_TRANS_UPDATE);
}
/* Skip first table, which is the table we are creating */
TABLE_LIST *create_table, *create_table_local;
tables= lex->unlink_first_table(tables, &create_table,
@ -2979,6 +2988,9 @@ unsent_create_error:
*/
if (thd->slave_thread)
lex->drop_if_exists= 1;
/* So that DROP TEMPORARY TABLE gets flushed to binlog */
thd->options|= (OPTION_STATUS_NO_TRANS_UPDATE);
}
res= mysql_rm_table(thd,tables,lex->drop_if_exists, lex->drop_temporary);
}