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

Addition to the fix to LP bug#994275.

It is problem of constant propagated to ref* access method (the problem was hiden by using debug binaries for testing).
This commit is contained in:
unknown
2012-05-08 19:13:26 +03:00
parent ea8314fdd5
commit 4e2926d927
2 changed files with 26 additions and 3 deletions

View File

@ -1289,8 +1289,19 @@ JOIN::optimize()
store_key *key_copy= tab->ref.key_copy[key_copy_index];
if (key_copy->type() == store_key::FIELD_STORE_KEY)
{
store_key_field *field_copy= ((store_key_field *)key_copy);
field_copy->change_source_field((Item_field *) item);
if (item->basic_const_item())
{
/* It is constant propagated here */
tab->ref.key_copy[key_copy_index]=
new store_key_const_item(*tab->ref.key_copy[key_copy_index],
item);
}
else
{
store_key_field *field_copy= ((store_key_field *)key_copy);
DBUG_ASSERT(item->type() == Item::FIELD_ITEM);
field_copy->change_source_field((Item_field *) item);
}
}
}
key_copy_index++;