Commit 1730ac5c authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-15348 Failure to load CREATE SEQUENCE...ROW_FORMAT=REDUNDANT

dict_sys_tables_type_valid(): Do not reject NO_ROLLBACK (sequence)
in ROW_FORMAT=REDUNDANT.

dict_load_table_low(): When flagging an error, assign *table = NULL.
Failure to do so could cause a crash if an error was flagged when
accessing INFORMATION_SCHEMA.INNODB_SYS_TABLES.
parent 86929730
......@@ -638,6 +638,9 @@ drop table s;
# MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANT
#
CREATE SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/seq1';
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
# test/seq1 12288 11 # Redundant 0 Single
DROP SEQUENCE seq1;
CREATE TEMPORARY SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
DROP TEMPORARY SEQUENCE seq1;
......@@ -455,6 +455,10 @@ drop table s;
--echo # MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANT
--echo #
CREATE SEQUENCE seq1 ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
--replace_column 1 # 5 #
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;
......@@ -1136,8 +1136,9 @@ dict_sys_tables_type_valid(ulint type, bool not_redundant)
}
if (!not_redundant) {
/* SYS_TABLES.TYPE must be 1 for ROW_FORMAT=REDUNDANT. */
return(false);
/* SYS_TABLES.TYPE must be 1 or 1|DICT_TF_MASK_NO_ROLLBACK
for ROW_FORMAT=REDUNDANT. */
return !(type & ~(1 | DICT_TF_MASK_NO_ROLLBACK));
}
if (type >= 1U << DICT_TF_POS_UNUSED) {
......@@ -2637,11 +2638,13 @@ dict_load_table_low(table_name_t& name, const rec_t* rec, dict_table_t** table)
ulint n_v_col;
if (const char* error_text = dict_sys_tables_rec_check(rec)) {
*table = NULL;
return(error_text);
}
if (!dict_sys_tables_rec_read(rec, name, &table_id, &space_id,
&t_num, &flags, &flags2)) {
*table = NULL;
return(dict_load_table_flags);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment