summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <gkodinov@dl145s.mysql.com>2006-10-20 10:57:38 +0200
committerunknown <gkodinov@dl145s.mysql.com>2006-10-20 10:57:38 +0200
commit0153d67e59c3049b94d7a28fa96cd963c202027d (patch)
treecf51611706126ce58f38d153ac2385b0a17a8b93 /sql/sql_base.cc
parent2576c4c0c90d00348c1bb17fa1a6f76e6e3988f3 (diff)
parent9bfaab57fa991d46844b5e56cb30880c8391c55d (diff)
downloadmariadb-git-0153d67e59c3049b94d7a28fa96cd963c202027d.tar.gz
Merge bk-internal:/home/bk/mysql-4.1
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt sql/sql_base.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 561d75a765e..c60bed09cf9 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2284,12 +2284,19 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
const char *field_name=0;
const char *table_name=0;
bool found_unaliased_non_uniq= 0;
+ /*
+ true if the item that we search for is a valid name reference
+ (and not an item that happens to have a name).
+ */
+ bool is_ref_by_name= 0;
uint unaliased_counter;
LINT_INIT(unaliased_counter);
*unaliased= FALSE;
- if (find->type() == Item::FIELD_ITEM || find->type() == Item::REF_ITEM)
+ is_ref_by_name= (find->type() == Item::FIELD_ITEM ||
+ find->type() == Item::REF_ITEM);
+ if (is_ref_by_name)
{
field_name= ((Item_ident*) find)->field_name;
table_name= ((Item_ident*) find)->table_name;
@@ -2401,7 +2408,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
}
else if (!table_name && (item->eq(find,0) ||
- find->name && item->name &&
+ is_ref_by_name && find->name && item->name &&
!my_strcasecmp(system_charset_info,
item->name,find->name)))
{