Skip to content
Permalink
Browse files
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.
  • Loading branch information
dr-m committed Apr 8, 2018
1 parent c0f5add commit 8beeedd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -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();
}

0 comments on commit 8beeedd

Please sign in to comment.