1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +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

@@ -368,3 +368,19 @@ show index from t2;
# Cleanup
DROP TABLE t1,t2;
--echo #
--echo # MDEV-26453 Assertion `0' failed in row_upd_sec_index_entry & corruption
--echo #
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t (c INT AUTO_INCREMENT KEY, UNIQUE USING HASH(c));
CREATE TABLE t (c INT AUTO_INCREMENT KEY);
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE UNIQUE INDEX i USING HASH ON t (c);
INSERT INTO t VALUES (0);
SELECT * FROM t;
DELETE FROM t;
DROP TABLE t;