From 6318e449e3e196d5e4ee0db73d63eac5ebd94195 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Aug 2005 17:01:46 +0200 Subject: Bug#11816 - Truncate table doesn't work with temporary innodb tables Handle temporary tables like permanent tables: If the storage engine cannot truncate, delete instead. mysql-test/r/innodb.result: Bug#11816 - Truncate table doesn't work with temporary innodb tables The test result. mysql-test/t/innodb.test: Bug#11816 - Truncate table doesn't work with temporary innodb tables The test case. sql/sql_delete.cc: Bug#11816 - Truncate table doesn't work with temporary innodb tables Handle temporary tables like permanent tables: If the storage engine cannot truncate, delete instead. Replaced a numeric literal by its symbolic name. --- mysql-test/t/innodb.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/t/innodb.test') diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index be502c2db44..a4b2c00f95a 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1202,4 +1202,22 @@ SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t DROP TABLE t2; DROP TABLE t1; +# +# Bug#11816 - Truncate table doesn't work with temporary innodb tables +# This is not an innodb bug, but we test it using innodb. +# +create temporary table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +drop table t1; +# Show that it works with permanent tables too. +create table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +drop table t1; + # End of 4.1 tests -- cgit v1.2.1