MWL#17: Table elimination

- When making inferences "field is bound" -> "key is bound", do check 
  that the field is part of the key
This commit is contained in:
Sergey Petrunya 2009-08-13 04:01:43 +04:00
parent b032c7d833
commit 40bb97b525

View file

@ -1043,7 +1043,8 @@ void eliminate_tables(JOIN *join)
DBUG_PRINT("info", ("key %s.%s is now bound",
key_dep->table->table->alias,
key_dep->table->table->key_info[key_dep->keyno].name));
if (!key_dep->bound)
if (field_dep->field->part_of_key.is_set(key_dep->keyno) &&
!key_dep->bound)
{
if (!--key_dep->n_missing_keyparts)
{