diff options
author | unknown <sanja@montyprogram.com> | 2012-05-08 19:13:26 +0300 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2012-05-08 19:13:26 +0300 |
commit | 4e2926d927e51f47f51ccbb0ec77ffd9999f68c2 (patch) | |
tree | 3e126040dc0f0741d2027641868eb4ffcf21a444 /sql/sql_select.cc | |
parent | ea8314fdd537d14061bb261e6494f38a8fc9291b (diff) | |
download | mariadb-git-4e2926d927e51f47f51ccbb0ec77ffd9999f68c2.tar.gz |
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).
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 86cab59fd2a..fccd94ec3cd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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++; |