mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-10228: Delete missing rows with OR conditions
Fix get_quick_keys(): When building range tree from a condition in form keypart1=const AND (keypart2 < 0 OR keypart2>=0) the SEL_ARG for keypart2 represents an interval (-inf, +inf). However, the logic that sets UNIQUE_RANGE flag fails to recognize this, and sets UNIQUE_RANGE flag if (keypart1, keypart2) covered a unique key. As a result, range access executor assumes the interval can have at most one row and only reads the first row from it.
This commit is contained in:
@ -10409,8 +10409,10 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
|
||||
KEY *table_key=quick->head->key_info+quick->index;
|
||||
flag=EQ_RANGE;
|
||||
if ((table_key->flags & HA_NOSAME) &&
|
||||
min_part == key_tree->part &&
|
||||
key_tree->part == table_key->key_parts-1)
|
||||
{
|
||||
DBUG_ASSERT(min_part == max_part);
|
||||
if ((table_key->flags & HA_NULL_PART_KEY) &&
|
||||
null_part_in_key(key,
|
||||
param->min_key,
|
||||
|
Reference in New Issue
Block a user