mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-24953: 10.5.9 crashes with large IN() list
The problem was in and_all_keys(), the code of MDEV-9759 which calculates the new tree weight: First, it didn't take into account the case when (next->next_key_part=tmp) == NULL and dereferenced a NULL pointer when getting tmp->weight. Second, "if (param->alloced_sel_args > SEL_ARG::MAX_SEL_ARGS) break" could leave the loop with incorrect value of weight. Fixed by introducing SEL_ARG::update_weight_locally() and calling it at the end of the function. This allows to avoid caring about all the above cases.
This commit is contained in:
@ -316,6 +316,8 @@ public:
|
||||
*/
|
||||
uint weight;
|
||||
enum { MAX_WEIGHT = 32000 };
|
||||
|
||||
void update_weight_locally();
|
||||
#ifndef DBUG_OFF
|
||||
uint verify_weight();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user