mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-4556 Server crashes in SEL_ARG::rb_insert with index_merge+index_merge_sort_union, FORCE INDEX
- merge_same_index_scans() may put the same SEL_ARG tree in multiple result plans. make it call incr_refs() on the SEL_ARG trees that it does key_or() on, because key_or(sel_arg_tree_1, sel_arg_tree_2) call may invalidate SEL_ARG trees pointed by sel_arg_tree_1 and sel_arg_tree_2.
This commit is contained in:
@ -4916,6 +4916,8 @@ TABLE_READ_PLAN *merge_same_index_scans(PARAM *param, SEL_IMERGE *imerge,
|
||||
bzero((*changed_tree)->keys,
|
||||
sizeof((*changed_tree)->keys[0])*param->keys);
|
||||
(*changed_tree)->keys_map.clear_all();
|
||||
key->incr_refs();
|
||||
(*tree)->keys[key_idx]->incr_refs();
|
||||
if (((*changed_tree)->keys[key_idx]=
|
||||
key_or(param, key, (*tree)->keys[key_idx])))
|
||||
(*changed_tree)->keys_map.set_bit(key_idx);
|
||||
|
Reference in New Issue
Block a user