From bd09c5ca866e273b6cebbd9a15c51c82bfa3ac9b Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 7 May 2018 16:39:53 +0300 Subject: [PATCH] Added test case for MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong Looks like the bug was fixed some time ago (at least I can't repeat it). I added the test case just have this case tested properly. --- .../suite/sql_sequence/temporary.result | 24 +++++++++++++++++++ mysql-test/suite/sql_sequence/temporary.test | 18 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/mysql-test/suite/sql_sequence/temporary.result b/mysql-test/suite/sql_sequence/temporary.result index 69463667210..b5c70fd3a50 100644 --- a/mysql-test/suite/sql_sequence/temporary.result +++ b/mysql-test/suite/sql_sequence/temporary.result @@ -17,3 +17,27 @@ drop temporary sequence s1; CREATE TEMPORARY SEQUENCE s1 ENGINE=InnoDB; INSERT INTO s1 VALUES (1, 1, 1000, 1, 1, 1, 1, 0); DROP TEMPORARY SEQUENCE s1; +# +# MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong +# +create temporary sequence s1 engine=aria; +alter table s1 engine myisam; +select nextval(s1); +nextval(s1) +1 +drop temporary sequence s1; +create temporary sequence s1 engine=innodb; +alter table s1 engine myisam; +select nextval(s1); +nextval(s1) +1 +drop temporary sequence s1; +create temporary sequence s1; +alter table s1 engine innodb; +select nextval(s1); +nextval(s1) +1 +select nextval(s1); +nextval(s1) +2 +drop temporary sequence s1; diff --git a/mysql-test/suite/sql_sequence/temporary.test b/mysql-test/suite/sql_sequence/temporary.test index 4943ed66ea4..aeacf6e9497 100644 --- a/mysql-test/suite/sql_sequence/temporary.test +++ b/mysql-test/suite/sql_sequence/temporary.test @@ -23,3 +23,21 @@ drop temporary sequence s1; CREATE TEMPORARY SEQUENCE s1 ENGINE=InnoDB; INSERT INTO s1 VALUES (1, 1, 1000, 1, 1, 1, 1, 0); DROP TEMPORARY SEQUENCE s1; + +--echo # +--echo # MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong +--echo # + +create temporary sequence s1 engine=aria; +alter table s1 engine myisam; +select nextval(s1); +drop temporary sequence s1; +create temporary sequence s1 engine=innodb; +alter table s1 engine myisam; +select nextval(s1); +drop temporary sequence s1; +create temporary sequence s1; +alter table s1 engine innodb; +select nextval(s1); +select nextval(s1); +drop temporary sequence s1;