From 4647982ee9c262eaee678db8532301f62a815053 Mon Sep 17 00:00:00 2001 From: "tim@threads.polyesthetic.msg" <> Date: Tue, 7 Nov 2000 01:52:43 -0500 Subject: [PATCH] Changes to make ALTER TABLE and DELETE FROM TABLE work properly with BEGIN WORK. --- sql/sql_delete.cc | 3 ++- sql/sql_parse.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 2e6bea7239e..29526b4d7d5 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -141,7 +141,8 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit, use_generate_table= (!using_limit && !conds && !(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) && - (thd->options & OPTION_AUTO_COMMIT)); + (thd->options & OPTION_AUTO_COMMIT) && + !(thd->options & OPTION_BEGIN)); if (use_generate_table && ! thd->open_tables) { error=generate_table(thd,table_list,(TABLE*) 0); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 915cda4e0f6..905b8a2af5e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1150,7 +1150,8 @@ mysql_execute_command(void) } } /* ALTER TABLE ends previous transaction */ - if (!(thd->options & OPTION_AUTO_COMMIT) && ha_commit(thd)) + if ((!(thd->options & OPTION_AUTO_COMMIT) || + (thd->options & OPTION_BEGIN)) && ha_commit(thd)) res= -1; else res= mysql_alter_table(thd, lex->db, lex->name,