MDEV-27973 SIGSEGV in ha_innobase::reset() after TRUNCATE of TEMPORARY TABLE
create_table_info_t::innobase_table_flags(): Ignore page_compressed and page_compression_level on TEMPORARY tables. ha_innobase::truncate(): Add a debug assertion that create() must succeed on temporary tables.
This commit is contained in:
parent
d96433ad20
commit
2db80c3773
@ -58,10 +58,13 @@ CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;
|
||||
DROP TABLE IF EXISTS t;
|
||||
SET GLOBAL innodb_compression_level=1;
|
||||
CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
|
||||
CREATE TEMPORARY TABLE tt(a INT PRIMARY KEY)
|
||||
ROW_FORMAT=DYNAMIC page_compressed=1 ENGINE=InnoDB;
|
||||
SET GLOBAL innodb_compression_level=0;
|
||||
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
|
||||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
|
||||
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
|
||||
ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
|
||||
DROP TABLE t;
|
||||
TRUNCATE tt;
|
||||
SET GLOBAL innodb_compression_level=@save_level;
|
||||
|
@ -69,10 +69,13 @@ DROP TABLE IF EXISTS t;
|
||||
|
||||
SET GLOBAL innodb_compression_level=1;
|
||||
CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
|
||||
CREATE TEMPORARY TABLE tt(a INT PRIMARY KEY)
|
||||
ROW_FORMAT=DYNAMIC page_compressed=1 ENGINE=InnoDB;
|
||||
SET GLOBAL innodb_compression_level=0;
|
||||
--error ER_ILLEGAL_HA_CREATE_OPTION
|
||||
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY;
|
||||
DROP TABLE t;
|
||||
TRUNCATE tt;
|
||||
SET GLOBAL innodb_compression_level=@save_level;
|
||||
|
@ -11776,29 +11776,33 @@ index_bad:
|
||||
zip_ssize = 0;
|
||||
}
|
||||
|
||||
ulint level = 0;
|
||||
|
||||
if (is_temp) {
|
||||
m_flags2 |= DICT_TF2_TEMPORARY;
|
||||
} else if (m_use_file_per_table) {
|
||||
m_flags2 |= DICT_TF2_USE_FILE_PER_TABLE;
|
||||
}
|
||||
} else {
|
||||
if (m_use_file_per_table) {
|
||||
m_flags2 |= DICT_TF2_USE_FILE_PER_TABLE;
|
||||
}
|
||||
|
||||
ulint level = ulint(options->page_compression_level);
|
||||
if (!level) {
|
||||
level = page_zip_level;
|
||||
if (!level && options->page_compressed) {
|
||||
push_warning_printf(
|
||||
m_thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_ILLEGAL_HA_CREATE_OPTION,
|
||||
"InnoDB: PAGE_COMPRESSED requires"
|
||||
" PAGE_COMPRESSION_LEVEL or"
|
||||
" innodb_compression_level > 0");
|
||||
DBUG_RETURN(false);
|
||||
level = ulint(options->page_compression_level);
|
||||
if (!level) {
|
||||
level = page_zip_level;
|
||||
if (!level && options->page_compressed) {
|
||||
push_warning_printf(
|
||||
m_thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_ILLEGAL_HA_CREATE_OPTION,
|
||||
"InnoDB: PAGE_COMPRESSED requires"
|
||||
" PAGE_COMPRESSION_LEVEL or"
|
||||
" innodb_compression_level > 0");
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the table flags */
|
||||
dict_tf_set(&m_flags, innodb_row_format, zip_ssize,
|
||||
m_use_data_dir, options->page_compressed, level);
|
||||
m_use_data_dir, level && options->page_compressed, level);
|
||||
|
||||
if (m_form->s->table_type == TABLE_TYPE_SEQUENCE) {
|
||||
m_flags |= DICT_TF_MASK_NO_ROLLBACK;
|
||||
@ -13856,6 +13860,7 @@ int ha_innobase::truncate()
|
||||
|
||||
int err = create(ib_table->name.m_name, table, &info, true,
|
||||
trx);
|
||||
ut_ad(!err);
|
||||
if (!err) {
|
||||
err = open(ib_table->name.m_name, 0, 0);
|
||||
m_prebuilt->stored_select_lock_type = stored_lock;
|
||||
|
Loading…
x
Reference in New Issue
Block a user