Commit 8beeeddd authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12266 fixup: Fix bug in row_ins_sec_index_entry()

row_ins_sec_index_entry(): Compare a pointer to fil_system.sys_space,
not to a numeric constant. This code was recently changed in MDEV-13637,
and the condition was essentially disabled, potentially causing the
change buffer to grow uncontrollably when something is inserted into
a table that has secondary indexes and resides in the system tablespace.

Thanks to Daniel Black for pointing out that clang 7 flagged a warning
for the comparison of a pointer to an integer.

row_import_for_mysql(): Fix a possible compiler warning.
parent c0f5adde
......@@ -3924,7 +3924,7 @@ row_import_for_mysql(
true, true, FIL_TYPE_IMPORT, table->space_id,
fsp_flags, table->name, filepath, &err);
ut_ad(!table->space == (err != DB_SUCCESS));
ut_ad((table->space == NULL) == (err != DB_SUCCESS));
DBUG_EXECUTE_IF("ib_import_open_tablespace_failure",
err = DB_TABLESPACE_NOT_FOUND; table->space = NULL;);
......
......@@ -3309,7 +3309,7 @@ row_ins_sec_index_entry(
if (err == DB_FAIL) {
mem_heap_empty(heap);
if (index->table->space == IBUF_SPACE_ID
if (index->table->space == fil_system.sys_space
&& !(index->type & (DICT_UNIQUE | DICT_SPATIAL))) {
ibuf_free_excess_pages();
}
......
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