1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-01 03:26:54 +03:00

MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1

Fixed by adding table flag HA_WANTS_PRIMARY_KEY, which is like
HA_REQUIRE_PRIMARY_KEY but tells SQL upper layer that the storage engine
internally can handle tables without primary keys (for example for
sequences or trough user variables)
This commit is contained in:
Monty
2018-10-29 16:12:52 +02:00
parent 6a6cc8a653
commit d30124e844
6 changed files with 31 additions and 2 deletions

View File

@ -462,3 +462,14 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/seq1';
DROP SEQUENCE seq1;
CREATE TEMPORARY SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
DROP TEMPORARY SEQUENCE seq1;
--echo #
--echo # MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1
--echo #
set global innodb_force_primary_key =1;
CREATE SEQUENCE s1 START WITH 100 INCREMENT BY 10 ENGINE=innodb;
set global innodb_force_primary_key=default;
--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
DROP SEQUENCE s1;