1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-17816 Crash in TRUNCATE TABLE when table creation fails

The error handling in the MDEV-13564 TRUNCATE TABLE was broken
when an error occurred during table creation.

row_create_index_for_mysql(): Do not drop the table on error.

fts_create_one_common_table(), fts_create_one_index_table():
Do drop the table on error.

create_index(), create_table_info_t::create_table():
Let the caller handle the index creation errors.

ha_innobase::create(): If create_table_info_t::create_table()
fails, drop the incomplete table, roll back the transaction,
and finally return an error to the caller.
This commit is contained in:
Marko Mäkelä
2018-11-26 12:50:27 +02:00
parent a81fceafb1
commit 2a31b82831
6 changed files with 48 additions and 34 deletions

View File

@ -15,3 +15,15 @@ TRUNCATE TABLE t;
disconnect dml;
DROP TABLE t;
--echo #
--echo # MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
--echo #
CREATE TABLE t1 (c VARCHAR(1024), KEY(c)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1 SET c='character';
# FIXME: MDEV-17833 ALTER TABLE is not enforcing prefix index size limit
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
--error ER_INDEX_COLUMN_TOO_LONG
TRUNCATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;