diff options
author | patg@krsna.patg.net <> | 2005-09-27 15:04:26 -0700 |
---|---|---|
committer | patg@krsna.patg.net <> | 2005-09-27 15:04:26 -0700 |
commit | acdc193a45a7f2952867a3d3f2373dd42e887ef2 (patch) | |
tree | f8190e21c9333f4125f0364d2f6ba3dbb9383aaf /sql | |
parent | 12e41de0cc21fdcfb29c4da4451d9db9dfece819 (diff) | |
parent | f5fc8f315e1f293c30f1963ee181ce3b2e43839e (diff) | |
download | mariadb-git-acdc193a45a7f2952867a3d3f2373dd42e887ef2.tar.gz |
Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.0
into krsna.patg.net:/home/patg/mysql-5.0
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 8 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sql/item.cc b/sql/item.cc index 45c12d3840f..92a7330374a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1687,7 +1687,7 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const return 0; Item_field *item_field= (Item_field*) item; - if (item_field->field) + if (item_field->field && field) return item_field->field == field; /* We may come here when we are trying to find a function in a GROUP BY @@ -1701,10 +1701,10 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const */ return (!my_strcasecmp(system_charset_info, item_field->name, field_name) && - (!item_field->table_name || + (!item_field->table_name || !table_name || (!my_strcasecmp(table_alias_charset, item_field->table_name, table_name) && - (!item_field->db_name || + (!item_field->db_name || !db_name || (item_field->db_name && !strcmp(item_field->db_name, db_name)))))); } @@ -2983,7 +2983,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list) for (ORDER *cur_group= group_list ; cur_group ; cur_group= cur_group->next) { - if ((*(cur_group->item))->type() == Item::FIELD_ITEM) + if ((*(cur_group->item))->real_item()->type() == Item::FIELD_ITEM) { cur_field= (Item_field*) *cur_group->item; cur_match_degree= 0; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 16842c4969c..715d38925aa 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3459,7 +3459,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter, } } } - else if (!table_name && (item->eq(find,0) || + else if (!table_name && (find->eq(item,0) || find->name && item->name && !my_strcasecmp(system_charset_info, item->name,find->name))) |