diff options
author | unknown <serg@serg.mylan> | 2005-04-14 22:09:38 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-04-14 22:09:38 +0200 |
commit | 2a8f6bb18818178e66ea9f1ba058a98c49a353fb (patch) | |
tree | 661063fa0dfcf988c6c06c78f436e4786bdec375 | |
parent | 46c63419a7caad749ab79a57b28a1d0de2414128 (diff) | |
parent | 1403fb000b58a171b094a93b35c4f93123c15b19 (diff) | |
download | mariadb-git-2a8f6bb18818178e66ea9f1ba058a98c49a353fb.tar.gz |
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
-rw-r--r-- | mysql-test/r/innodb.result | 1 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 1 | ||||
-rw-r--r-- | sql/sql_delete.cc | 8 |
3 files changed, 8 insertions, 2 deletions
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index c282ec68c78..f00679801f8 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -821,6 +821,7 @@ truncate table t1; Can't execute the given command because you have active locked tables or an active transaction commit; truncate table t1; +truncate table t1; select * from t1; a insert into t1 values(1),(2); diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 34eabcc22df..2c8002ea841 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -528,6 +528,7 @@ insert into t1 values(1),(2); truncate table t1; commit; truncate table t1; +truncate table t1; select * from t1; insert into t1 values(1),(2); delete from t1; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 475df34dc4f..166a0e130e3 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -590,8 +590,12 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) { /* Probably InnoDB table */ table_list->lock_type= TL_WRITE; - DBUG_RETURN(mysql_delete(thd, table_list, (COND*) 0, (ORDER*) 0, - HA_POS_ERROR, 0)); + ulong save_options= thd->options; + thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT); + int res= mysql_delete(thd, table_list, (COND*) 0, (ORDER*) 0, + HA_POS_ERROR, 0); + thd->options= save_options; + DBUG_RETURN(res); } if (lock_and_wait_for_table_name(thd, table_list)) DBUG_RETURN(-1); |