summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp.test
diff options
context:
space:
mode:
authorunknown <svoj@april.(none)>2006-04-06 15:19:01 +0500
committerunknown <svoj@april.(none)>2006-04-06 15:19:01 +0500
commitee3cf23b5ca8edf86d01dd4476d9769a8aaf49ce (patch)
tree03df9bcbdcaf7e9d48482604e706d38dc3aa5635 /mysql-test/t/sp.test
parent66ac19e2cf721ae9f02f5045376bdbbb9f1597c5 (diff)
downloadmariadb-git-ee3cf23b5ca8edf86d01dd4476d9769a8aaf49ce.tar.gz
Fix for bug#14945 "Truncate table doesn't reset the auto_increment
counter". When TRUNCATE TABLE was called within an stored procedure the auto_increment counter was not reset to 0 even if straight TRUNCATE for this table did this. This fix makes TRUNCATE in stored procedures to be handled exactly in the same way as straight TRUNCATE. We achieve this by rolling back the fix for bug 8850, which is no longer needed since stored procedures don't require prelocked mode anymore (and TRUNCATE is not allowed in stored functions or triggers). mysql-test/r/sp.result: Test case for BUG#14945. mysql-test/t/sp.test: Test case for BUG#14945. sql/sql_delete.cc: Handle TRUNCATE in stored procedures exactly in the same way as straight TRUNCATE (i.e. without falling back to DELETE if possible). We achieve this by rolling back the fix for bug 8850, which is no longer relevant since stored procedures don't require prelocked mode anymore (and TRUNCATE is not allowed in stored functions or triggers). sql/sql_parse.cc: Handle TRUNCATE in stored procedures exactly in the same way as straight TRUNCATE (i.e. without falling back to DELETE if possible). We achieve this by rolling back the fix for bug 8850, which is no longer relevant since stored procedures don't require prelocked mode anymore (and TRUNCATE is not allowed in stored functions or triggers).
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r--mysql-test/t/sp.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 9e1afa53149..1658e06d518 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -5666,6 +5666,21 @@ begin
select id from t1 order by x;
end|
+#
+# BUG#14945: Truncate table doesn't reset the auto_increment counter
+#
+--disable_warnings
+drop procedure if exists bug14945|
+--enable_warnings
+create table t3 (id int not null auto_increment primary key)|
+create procedure bug14945() deterministic truncate t3|
+insert into t3 values (null)|
+call bug14945()|
+insert into t3 values (null)|
+select * from t3|
+drop table t3|
+drop procedure bug14945|
+
# This does NOT order by column index; variable is an expression.
create procedure bug16474_2(x int)
select id from t1 order by x|