From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/suite/sql_sequence/view.test | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 mysql-test/suite/sql_sequence/view.test (limited to 'mysql-test/suite/sql_sequence/view.test') diff --git a/mysql-test/suite/sql_sequence/view.test b/mysql-test/suite/sql_sequence/view.test new file mode 100644 index 00000000..affac002 --- /dev/null +++ b/mysql-test/suite/sql_sequence/view.test @@ -0,0 +1,42 @@ +--source include/have_sequence.inc +--source include/have_innodb.inc + +# +# Test sequences with views +# + +create sequence s1; +create view v1 as select * from s1; +create view v2 as select next value for s1; +--disable_ps2_protocol +select * from v1; +select * from v2; +select * from v2; +--enable_ps2_protocol +--error ER_NOT_SEQUENCE +select next value for v1; +drop sequence s1; +drop view v1,v2; + +--echo # +--echo # MDEV 13020 Server crashes in Item_func_nextval::val_int upon +--echo # selecting NEXT or PREVIOUS VALUE for a view +--echo # + +CREATE OR REPLACE VIEW v1 AS SELECT 1 AS f; +--error ER_NOT_SEQUENCE +SELECT NEXT VALUE FOR v1; +--error ER_NOT_SEQUENCE +SELECT PREVIOUS VALUE FOR v1; +drop view v1; + +--echo # +--echo # MDEV 17978 Server crashes in mysqld_show_create_get_fields +--echo # upon SHOW CREATE SEQUENCE on a broken view +--echo # +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +DROP TABLE t1; +--error ER_NOT_SEQUENCE +SHOW CREATE SEQUENCE v1; +DROP VIEW v1; -- cgit v1.2.3