1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-26453 Assertion `0' failed in row_upd_sec_index_entry & corruption

Long UNIQUE HASH index silently creates virtual column index, which should
be impossible for base columns featuring AUTO_INCREMENT.

Fix: add a relevant check; add new vcol type for a prettier error message.
This commit is contained in:
Nikita Malyavin
2021-10-28 03:37:23 +03:00
parent fcca0c67b6
commit 1fdac57447
4 changed files with 38 additions and 0 deletions

View File

@ -288,3 +288,17 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t2 0 a 1 a A NULL NULL NULL YES HASH
t2 0 a 2 b A NULL NULL NULL YES HASH
DROP TABLE t1,t2;
#
# MDEV-26453 Assertion `0' failed in row_upd_sec_index_entry & corruption
#
CREATE TABLE t (c INT AUTO_INCREMENT KEY, UNIQUE USING HASH(c));
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `c`
CREATE TABLE t (c INT AUTO_INCREMENT KEY);
CREATE UNIQUE INDEX i USING HASH ON t (c);
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `c`
INSERT INTO t VALUES (0);
SELECT * FROM t;
c
1
DELETE FROM t;
DROP TABLE t;