diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-01-30 17:38:14 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-01-30 17:38:14 +0400 |
commit | 9fce78a48225e0aa584d590943e460ce98649669 (patch) | |
tree | 68f80ad85349f480898658170fe9eee1fdb252ac /sql | |
parent | 5ca1dd8f0b22d6b5aea06c9ad32481498cb99d6e (diff) | |
parent | 53fde5bb6f98896c0ccd9b60a9576e5c5fef8a91 (diff) | |
download | mariadb-git-9fce78a48225e0aa584d590943e460ce98649669.tar.gz |
Merge fix for BUG#922254
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_cmpfunc.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 8b8a85ca59b..ddb80a3ed81 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5853,13 +5853,15 @@ Item* Item_equal::get_first(JOIN_TAB *context, Item *field_item) if (emb_nest && emb_nest->sj_mat_info && emb_nest->sj_mat_info->is_used) { /* - It's a field from an materialized semi-join. We can substitute it only - for a field from the same semi-join. Find the first of such items. + It's a field from an materialized semi-join. We can substitute it for + - a constant item + - a field from the same semi-join + Find the first of such items: */ - while ((item= it++)) { - if (it.get_curr_field()->table->pos_in_table_list->embedding == emb_nest) + if (item->const_item() || + it.get_curr_field()->table->pos_in_table_list->embedding == emb_nest) { /* If we found given field then return NULL to avoid unnecessary |