summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-04-26 19:58:43 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-05-06 22:21:55 +0200
commita22a339f8e044a1e8df011beb0b4c8f43792ac96 (patch)
treeffb0a1eb908701f7ad135f27bb8be51532fc3f0b
parent724ab9a1cb7b23ba93ca5df77f631b5c565f3059 (diff)
downloadmariadb-git-a22a339f8e044a1e8df011beb0b4c8f43792ac96.tar.gz
MDEV-13024: Server crashes in my_store_ptr upon DELETE from sequence in multi-table format
It is test only (fix was done by Monty in ha_sequence::open by allocating ref)
-rw-r--r--mysql-test/suite/sql_sequence/other.result16
-rw-r--r--mysql-test/suite/sql_sequence/other.test20
2 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result
index a56eb4d09a7..ff58e35772b 100644
--- a/mysql-test/suite/sql_sequence/other.result
+++ b/mysql-test/suite/sql_sequence/other.result
@@ -194,3 +194,19 @@ ERROR HY000: Function or expression 'setval()' cannot be used in the CHECK claus
CREATE TABLE t1 (a int, b int as (next value for s1 > 0));
ERROR HY000: Function or expression 'nextval()' cannot be used in the GENERATED ALWAYS AS clause of `b`
drop sequence s1;
+#
+# MDEV-13024: Server crashes in my_store_ptr upon DELETE from
+# sequence in multi-table format
+#
+CREATE SEQUENCE s;
+CREATE table t1 (a int);
+insert into t1 values (1),(2);
+DELETE s FROM s;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+delete t1,s from s,t1;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+delete s,t1 from t1,s;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+DROP SEQUENCE s;
+DROP TABLE t1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/sql_sequence/other.test b/mysql-test/suite/sql_sequence/other.test
index a493687faa3..5759b195950 100644
--- a/mysql-test/suite/sql_sequence/other.test
+++ b/mysql-test/suite/sql_sequence/other.test
@@ -160,3 +160,23 @@ CREATE table t1 (a int check (setval(s1,10)));
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (a int, b int as (next value for s1 > 0));
drop sequence s1;
+
+
+--echo #
+--echo # MDEV-13024: Server crashes in my_store_ptr upon DELETE from
+--echo # sequence in multi-table format
+--echo #
+CREATE SEQUENCE s;
+CREATE table t1 (a int);
+insert into t1 values (1),(2);
+--error ER_ILLEGAL_HA
+DELETE s FROM s;
+--error ER_ILLEGAL_HA
+delete t1,s from s,t1;
+--error ER_ILLEGAL_HA
+delete s,t1 from t1,s;
+DROP SEQUENCE s;
+DROP TABLE t1;
+
+
+--echo # End of 10.3 tests