summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2006-10-16 13:24:54 +0300
committerunknown <gkodinov/kgeorge@macbook.gmz>2006-10-16 13:24:54 +0300
commitfe4a68fb3cd4178b49c824b7a375e505e89e792a (patch)
tree33ab2d08c472fe2b9dcbf3904fe634943d077973 /sql/sql_base.cc
parentb6248f76ed201d524ccc9b33cae2d961a0724c5e (diff)
parent750a2a0b862ba6a02c341a6120a96a081a83ac4f (diff)
downloadmariadb-git-fe4a68fb3cd4178b49c824b7a375e505e89e792a.tar.gz
Merge macbook.gmz:/Users/kgeorge/mysql/work/B14019-4.1-opt
into macbook.gmz:/Users/kgeorge/mysql/work/B14019-5.0-opt mysql-test/r/func_gconcat.result: Auto merged mysql-test/t/func_gconcat.test: Auto merged sql/sql_base.cc: Auto merged mysql-test/r/group_by.result: merge 4.1->5.0 mysql-test/t/group_by.test: merge 4.1->5.0
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 85be84d1270..047fb8f3cff 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3450,13 +3450,20 @@ 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); // Dependent on found_unaliased
*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;
@@ -3568,7 +3575,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
}
else if (!table_name && (find->eq(item,0) ||
- find->name && item->name &&
+ is_ref_by_name && find->name && item->name &&
!my_strcasecmp(system_charset_info,
item->name,find->name)))
{