summaryrefslogtreecommitdiff
path: root/mysql-test/r/truncate.result
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-08-23 16:15:57 +0200
committerunknown <guilhem@mysql.com>2004-08-23 16:15:57 +0200
commite9c25d9336c8d1266254df5f795366e7d280de85 (patch)
tree473c7951f1ebf8ee281da1848e8cadc3e2cf68e1 /mysql-test/r/truncate.result
parent38b8c98543e68b3185a491b3cb9fb9d48662ef14 (diff)
downloadmariadb-git-e9c25d9336c8d1266254df5f795366e7d280de85.tar.gz
Fix for BUG#5033 "When using temporary tables truncate does NOT reset the auto_increment counter"
(ok'd by CTO to fix it in 4.0). Fix to make mysql-test-run work with all Valgrind versions. mysql-test/mysql-test-run.sh: fixing mysql-test-run.sh so that it works indifferently with Valgrind 1.x, 2.x (versions <= 2.0.0 refuse --tool option; versions >=2.1.2 require it; 2.1.0 accepts it). I hope the shell code is portable enough; anyway Valgrind only runs on Linux... I tested it with 2.0.0, 2.1.0, 2.1.2. mysql-test/r/truncate.result: result update mysql-test/t/truncate.test: testing if TRUNCATE resets autoinc counter for temp tables (BUG#5033); testing difference with DELETE FROM. sql/sql_delete.cc: in mysql_truncate(), always reset the autoinc counter, as manual says (even if it's a temp table, which was BUG#5033).
Diffstat (limited to 'mysql-test/r/truncate.result')
-rw-r--r--mysql-test/r/truncate.result21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result
index 1b387214292..fef15533738 100644
--- a/mysql-test/r/truncate.result
+++ b/mysql-test/r/truncate.result
@@ -31,4 +31,25 @@ SELECT * from t1;
a
1
2
+delete from t1;
+insert into t1 (a) values (NULL),(NULL);
+SELECT * from t1;
+a
+3
+4
+drop table t1;
+create temporary table t1 (a integer auto_increment primary key);
+insert into t1 (a) values (NULL),(NULL);
+truncate table t1;
+insert into t1 (a) values (NULL),(NULL);
+SELECT * from t1;
+a
+1
+2
+delete from t1;
+insert into t1 (a) values (NULL),(NULL);
+SELECT * from t1;
+a
+3
+4
drop table t1;