diff options
author | lars@mysql.com <> | 2005-06-07 16:48:38 +0200 |
---|---|---|
committer | lars@mysql.com <> | 2005-06-07 16:48:38 +0200 |
commit | 53085bb4432e1ace5200cceacc0740bdf5c55b01 (patch) | |
tree | ffdf2f83da4ee9e7a936af95f6500bd28a040139 /sql/sql_parse.cc | |
parent | 451bc09790a9f6cd06efc26a838d8682efd1cb15 (diff) | |
parent | b6402bd4e4d3c32985e815c3cddb4b6054134a39 (diff) | |
download | mariadb-git-53085bb4432e1ace5200cceacc0740bdf5c55b01.tar.gz |
Merge mysql.com:/home/bkroot/mysql-5.0 into mysql.com:/home/bk/mysql-5.0
Diffstat (limited to 'sql/sql_parse.cc')
-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 7d00cfa4c98..3bc5e17713e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2764,6 +2764,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; + } DBUG_ASSERT(first_table == all_tables && first_table != 0); bool link_to_local; // Skip first table, which is the table we are creating @@ -3258,6 +3272,11 @@ end_with_restore_list: break; } case SQLCOM_TRUNCATE: + if (end_active_trans(thd)) + { + res= -1; + break; + } DBUG_ASSERT(first_table == all_tables && first_table != 0); if (check_one_table_access(thd, DELETE_ACL, all_tables)) goto error; @@ -3352,6 +3371,9 @@ end_with_restore_list: */ 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, first_table, lex->drop_if_exists, lex->drop_temporary); @@ -3490,6 +3512,11 @@ end_with_restore_list: 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)) { @@ -3520,6 +3547,11 @@ end_with_restore_list: } case SQLCOM_DROP_DB: { + if (end_active_trans(thd)) + { + res= -1; + break; + } if (check_db_name(lex->name)) { my_error(ER_WRONG_DB_NAME, MYF(0), lex->name); |