1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt

into  rakia.gmz:/home/kgeorge/mysql/autopush/B16590-5.1-opt
This commit is contained in:
gkodinov/kgeorge@rakia.gmz
2007-01-22 12:58:14 +02:00
3 changed files with 38 additions and 0 deletions

View File

@ -7722,6 +7722,22 @@ static void update_const_equal_items(COND *cond, JOIN_TAB *tab)
key_map possible_keys= field->key_start;
possible_keys.intersect(field->table->keys_in_use_for_query);
stat[0].const_keys.merge(possible_keys);
/*
For each field in the multiple equality (for which we know that it
is a constant) we have to find its corresponding key part, and set
that key part in const_key_parts.
*/
if (!possible_keys.is_clear_all())
{
TABLE *tab= field->table;
KEYUSE *use;
for (use= stat->keyuse; use && use->table == tab; use++)
if (possible_keys.is_set(use->key) &&
tab->key_info[use->key].key_part[use->keypart].field ==
field)
tab->const_key_parts[use->key]|= use->keypart_map;
}
}
}
}