MDEV-19114 post-push fix: SIGSEGV on INSERT
ins_node_create_entry_list(): Create dummy empty tuples for corrupted or incomplete indexes, to avoid dereferencing a NULL dict_field_t::col pointer in row_build_index_entry_low(). This issue was found by a crash in the test gcol.innodb_virtual_basic when merging the fix to 10.5.
This commit is contained in:
parent
ed29782a03
commit
22a6fa572b
@ -95,33 +95,20 @@ ins_node_create(
|
|||||||
return(node);
|
return(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************//**
|
/** Create an row template for each index of a table. */
|
||||||
Creates an entry template for each index of a table. */
|
static void ins_node_create_entry_list(ins_node_t *node)
|
||||||
static
|
|
||||||
void
|
|
||||||
ins_node_create_entry_list(
|
|
||||||
/*=======================*/
|
|
||||||
ins_node_t* node) /*!< in: row insert node */
|
|
||||||
{
|
{
|
||||||
dict_index_t* index;
|
|
||||||
dtuple_t* entry;
|
|
||||||
|
|
||||||
ut_ad(node->entry_sys_heap);
|
|
||||||
|
|
||||||
/* We will include all indexes (include those corrupted
|
|
||||||
secondary indexes) in the entry list. Filtration of
|
|
||||||
these corrupted index will be done in row_ins() */
|
|
||||||
|
|
||||||
node->entry_list.reserve(UT_LIST_GET_LEN(node->table->indexes));
|
node->entry_list.reserve(UT_LIST_GET_LEN(node->table->indexes));
|
||||||
|
|
||||||
for (index = dict_table_get_first_index(node->table);
|
for (dict_index_t *index= dict_table_get_first_index(node->table); index;
|
||||||
index != 0;
|
index= dict_table_get_next_index(index))
|
||||||
index = dict_table_get_next_index(index)) {
|
{
|
||||||
|
/* Corrupted or incomplete secondary indexes will be filtered out in
|
||||||
entry = row_build_index_entry_low(
|
row_ins(). */
|
||||||
node->row, NULL, index, node->entry_sys_heap,
|
dtuple_t *entry= index->online_status >= ONLINE_INDEX_ABORTED
|
||||||
|
? dtuple_create(node->entry_sys_heap, 0)
|
||||||
|
: row_build_index_entry_low(node->row, NULL, index, node->entry_sys_heap,
|
||||||
ROW_BUILD_FOR_INSERT);
|
ROW_BUILD_FOR_INSERT);
|
||||||
|
|
||||||
node->entry_list.push_back(entry);
|
node->entry_list.push_back(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user