| 1 |
--source include/have_sequence.inc |
| 2 |
--source include/have_innodb.inc |
| 3 |
|
| 4 |
# |
| 5 |
# MDEV-15149 Assorted assertion failures upon concurrent creating / querying |
| 6 |
# sequences (same test case) |
| 7 |
# |
| 8 |
|
| 9 |
CREATE SEQUENCE s1 ENGINE=InnoDB; |
| 10 |
CREATE SEQUENCE s2 ENGINE=InnoDB; |
| 11 |
|
| 12 |
--connect (con1,localhost,root,,test) |
| 13 |
--send CREATE TABLE s3 LIKE s2; |
| 14 |
|
| 15 |
--connection default |
| 16 |
CREATE SEQUENCE s4 ENGINE=InnoDB; |
| 17 |
SELECT * from s1 WHERE start_value IN (SELECT start_value FROM s2); |
| 18 |
|
| 19 |
--connection con1 |
| 20 |
--reap |
| 21 |
|
| 22 |
# Cleanup |
| 23 |
--disconnect con1 |
| 24 |
--connection default |
| 25 |
DROP SEQUENCE s1, s2, s3, s4; |
| 26 |
|
| 27 |
# |
| 28 |
# Check prepared statements |
| 29 |
# |
| 30 |
|
| 31 |
CREATE SEQUENCE s1 ENGINE=InnoDB; |
| 32 |
PREPARE stmt FROM "CREATE TABLE s2 LIKE s1"; |
| 33 |
execute stmt; |
| 34 |
drop table s2; |
| 35 |
execute stmt; |
| 36 |
drop table s2; |
| 37 |
execute stmt; |
| 38 |
select * from s2; |
| 39 |
DROP SEQUENCE s1, s2; |
| 40 |
|
| 41 |
# |
| 42 |
# MDEV-15117 Server crashes in in open_and_process_table or ASAN |
| 43 |
# heap-use-after-free in is_temporary_table upon creating/flushing sequences |
| 44 |
# |
| 45 |
|
| 46 |
CREATE SEQUENCE s1 ENGINE=InnoDB; |
| 47 |
--connect (con1,localhost,root,,test) |
| 48 |
--send CREATE TABLE s2 LIKE s1; |
| 49 |
--connection default |
| 50 |
FLUSH TABLES; |
| 51 |
|
| 52 |
# Cleanup |
| 53 |
--connection con1 |
| 54 |
--reap |
| 55 |
--disconnect con1 |
| 56 |
--connection default |
| 57 |
|
| 58 |
DROP TABLE s1,s2; |
| 59 |
|
| 60 |
# |
| 61 |
# MDEV-24545 Sequence created by one connection remains invisible to another |
| 62 |
# |
| 63 |
CREATE TABLE t1 (a INT) ENGINE=InnoDB; |
| 64 |
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
| 65 |
|
| 66 |
--connect (con1,localhost,root,,test) |
| 67 |
CREATE SEQUENCE s1 ENGINE=InnoDB; |
| 68 |
FLUSH TABLES; |
| 69 |
--disconnect con1 |
| 70 |
|
| 71 |
--connection default |
| 72 |
--disable_ps2_protocol |
| 73 |
SELECT NEXTVAL(s1); |
| 74 |
--enable_ps2_protocol |
| 75 |
COMMIT; |
| 76 |
|
| 77 |
# Cleanup |
| 78 |
DROP TABLE t1; |
| 79 |
DROP SEQUENCE s1; |
| 80 |
|
| 81 |
--echo # |
| 82 |
--echo # MDEV-28152 Features for sequence |
| 83 |
--echo # |
| 84 |
|
| 85 |
CREATE SEQUENCE s1 as mediumint unsigned ENGINE=InnoDB; |
| 86 |
PREPARE stmt FROM "CREATE TABLE s2 LIKE s1"; |
| 87 |
execute stmt; |
| 88 |
drop table s2; |
| 89 |
execute stmt; |
| 90 |
show create sequence s2; |
| 91 |
drop table s2; |
| 92 |
execute stmt; |
| 93 |
select * from s2; |
| 94 |
DROP SEQUENCE s1, s2; |
| 95 |
|
| 96 |
--echo # |
| 97 |
--echo # End of 11.5 tests |
| 98 |
--echo # |