diff options
author | unknown <lars@mysql.com> | 2005-06-07 16:31:10 +0200 |
---|---|---|
committer | unknown <lars@mysql.com> | 2005-06-07 16:31:10 +0200 |
commit | 0d2788ba8c85ab24eacb2155458397a24e16208b (patch) | |
tree | 8f0f305eaabe979129fa22c3efecc29f5cb7d740 /sql | |
parent | beb288f4860b62bc9792bdfdd826d7ad11664eba (diff) | |
parent | 6dc86a20c1383b28e268d2e76b2933df07a1dba7 (diff) | |
download | mariadb-git-0d2788ba8c85ab24eacb2155458397a24e16208b.tar.gz |
Merge mysql.com:/home/bkroot/mysql-4.1
into mysql.com:/home/bk/b6883-mysql-4.1
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f0ea0a762bd..cd84c66cbba 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2407,6 +2407,20 @@ 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)) + { + if (end_active_trans(thd)) + { + res= -1; + break; + } + } + else + { + /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */ + 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, @@ -2870,6 +2884,11 @@ unsent_create_error: break; } case SQLCOM_TRUNCATE: + if (end_active_trans(thd)) + { + res= -1; + break; + } if (check_one_table_access(thd, DELETE_ACL, tables)) goto error; /* @@ -2984,6 +3003,9 @@ unsent_create_error: */ if (thd->slave_thread) lex->drop_if_exists= 1; + + /* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */ + thd->options|= OPTION_STATUS_NO_TRANS_UPDATE; } res= mysql_rm_table(thd,tables,lex->drop_if_exists, lex->drop_temporary); } @@ -3228,6 +3250,11 @@ purposes internal to the MySQL server", MYF(0)); break; case SQLCOM_CREATE_DB: { + if (end_active_trans(thd)) + { + res= -1; + break; + } char *alias; if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name)) { @@ -3258,6 +3285,11 @@ purposes internal to the MySQL server", MYF(0)); } case SQLCOM_DROP_DB: { + if (end_active_trans(thd)) + { + res= -1; + break; + } char *alias; if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name)) { |