[Commits] 35e9c9319b8: MDEV-13024: Server crashes in my_store_ptr upon DELETE from sequence in multi-table format

Oleksandr Byelkin sanja at mariadb.com
Thu Apr 26 20:58:43 EEST 2018


revision-id: 35e9c9319b8cbb9aec1d452caa46a17c887312c8 (mariadb-10.3.6-53-g35e9c9319b8)
parent(s): 0bdc15d86ea94df6ed7ac07e69309d7b9b7281b2
author: Oleksandr Byelkin
committer: Oleksandr Byelkin
timestamp: 2018-04-26 19:58:43 +0200
message:

MDEV-13024: Server crashes in my_store_ptr upon DELETE from sequence in multi-table format

Make operation possition() dummy for sequences (should not be used really)

---
 mysql-test/suite/sql_sequence/other.result |  9 +++++++++
 mysql-test/suite/sql_sequence/other.test   | 13 +++++++++++++
 sql/ha_sequence.h                          |  2 +-
 3 files changed, 23 insertions(+), 1 deletion(-)

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 @@ class ha_sequence :public handler
     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


More information about the commits mailing list