1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -6,3 +6,15 @@ connection default;
TRUNCATE TABLE t;
disconnect dml;
DROP TABLE t;
#
# MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
#
CREATE TABLE t1 (c VARCHAR(1024), KEY(c)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1 SET c='character';
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
TRUNCATE TABLE t1;
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
SELECT * FROM t1;
c
character
DROP TABLE t1;