summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-04-26 19:58:43 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-04-26 19:58:43 +0200
commit35e9c9319b8cbb9aec1d452caa46a17c887312c8 (patch)
treea28b0df865317d8ecb6a60b0be600285263d6822
parent0bdc15d86ea94df6ed7ac07e69309d7b9b7281b2 (diff)
downloadmariadb-git-bb-10.3-MDEV-13024.tar.gz
MDEV-13024: Server crashes in my_store_ptr upon DELETE from sequence in multi-table formatbb-10.3-MDEV-13024
Make operation possition() dummy for sequences (should not be used really)
-rw-r--r--mysql-test/suite/sql_sequence/other.result9
-rw-r--r--mysql-test/suite/sql_sequence/other.test13
-rw-r--r--sql/ha_sequence.h2
3 files changed, 23 insertions, 1 deletions
diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result
index e3ec94cf2c5..500fca9a065 100644
--- a/mysql-test/suite/sql_sequence/other.result
+++ b/mysql-test/suite/sql_sequence/other.result
@@ -184,3 +184,12 @@ 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;
+DELETE s FROM s;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s` doesn't have this option
+DROP SEQUENCE s;
+# End of 10.3 tests
diff --git a/mysql-test/suite/sql_sequence/other.test b/mysql-test/suite/sql_sequence/other.test
index ff0db9e158d..8f35afd73de 100644
--- a/mysql-test/suite/sql_sequence/other.test
+++ b/mysql-test/suite/sql_sequence/other.test
@@ -157,3 +157,16 @@ 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;
+--error ER_ILLEGAL_HA
+DELETE s FROM s;
+DROP SEQUENCE s;
+
+
+--echo # End of 10.3 tests
diff --git a/sql/ha_sequence.h b/sql/ha_sequence.h
index fd9da05b591..b3789914e18 100644
--- a/sql/ha_sequence.h
+++ b/sql/ha_sequence.h
@@ -123,7 +123,7 @@ public:
return error;
}
void position(const uchar *record)
- { return file->position(record); }
+ { }
const char *table_type() const
{ return file->table_type(); }
ulong index_flags(uint inx, uint part, bool all_parts) const