mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-25069: Assertion `root->weight >= ...' failed in SEL_ARG::tree_delete #2
Note they key_or() may call tree_delete(), which will cause the weight asserts to be checked. In order to avoid them from firing, update key1 tree's weight after we've changed key1->some_local_child->next_key_part. Having done that, do we still need this at the function end: /* Re-compute the result tree's weight. */ key1->update_weight_locally(); ?
This commit is contained in:
@@ -10642,9 +10642,15 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2)
|
||||
*/
|
||||
tmp->maybe_flag|= key2_cpy.maybe_flag;
|
||||
key2_cpy.increment_use_count(key1->use_count+1);
|
||||
|
||||
uint old_weight= tmp->next_key_part? tmp->next_key_part->weight: 0;
|
||||
|
||||
tmp->next_key_part= key_or(param, tmp->next_key_part,
|
||||
key2_cpy.next_key_part);
|
||||
|
||||
uint new_weight= tmp->next_key_part? tmp->next_key_part->weight: 0;
|
||||
key1->weight += (new_weight - old_weight);
|
||||
|
||||
if (!cmp)
|
||||
break; // case b: done with this key2 range
|
||||
|
||||
|
Reference in New Issue
Block a user