1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

BUG#19055: There may exist a SEL_TREE objects with type==KEY and keys[i]==NULL for any i.

(for example, such objects can be returned from get_mm_parts() for "string_field = int_val).
Make find_used_partitions_imerge() to handle such SEL_TREE objects.
This commit is contained in:
sergefp@mysql.com
2006-06-04 17:17:37 +04:00
parent b615e0b6dc
commit 9e425092d6
3 changed files with 26 additions and 3 deletions

View File

@ -374,6 +374,12 @@ public:
keys_map.clear_all();
bzero((char*) keys,sizeof(keys));
}
/*
Note: there may exist SEL_TREE objects with sel_tree->type=KEY and
keys[i]=0 for all i. (SergeyP: it is not clear whether there is any
merit in range analyzer functions (e.g. get_mm_parts) returning a
pointer to such SEL_TREE instead of NULL)
*/
SEL_ARG *keys[MAX_KEY];
key_map keys_map; /* bitmask of non-NULL elements in keys */
@ -2580,7 +2586,8 @@ int find_used_partitions_imerge(PART_PRUNE_PARAM *ppar, SEL_IMERGE *imerge)
ppar->cur_part_fields= 0;
ppar->cur_subpart_fields= 0;
init_all_partitions_iterator(ppar->part_info, &ppar->part_iter);
if (-1 == (res |= find_used_partitions(ppar, (*ptree)->keys[0])))
SEL_ARG *key_tree= (*ptree)->keys[0];
if (!key_tree || (-1 == (res |= find_used_partitions(ppar, key_tree))))
return -1;
}
return res;
@ -5104,7 +5111,7 @@ get_mm_parts(RANGE_OPT_PARAM *param, COND *cond_func, Field *field,
tree->keys_map.set_bit(key_part->key);
}
}
DBUG_RETURN(tree);
}