summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-08-31 14:35:04 +0300
committermonty@mysql.com <>2004-08-31 14:35:04 +0300
commit6adaff23a4b2170f59dda27cd5b897adb40c2542 (patch)
tree0b5dee6e825afda907f8333d42fa031460fb3597 /sql/sql_base.cc
parentceba1429b731a0712f49bcd43f70aabc41e8094f (diff)
downloadmariadb-git-6adaff23a4b2170f59dda27cd5b897adb40c2542.tar.gz
Review of new pushed code (Indentation fixes and simple optimizations)
Use 'mysqltest' as test database instead of test_$1 or test1,test2 to not accidently delete an important database Safety fix for mailformed MERGE files
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index dede280325d..92364b23461 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2138,7 +2138,10 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
select list over other fields from the tables participating in
this select in case of ambiguity.
- QQ: Why do we use simple strcmp for table name comparison here ?
+ We use strcmp for table names and database names as these may be
+ case sensitive.
+ In cases where they are not case sensitive, they are always in lower
+ case.
*/
if (!my_strcasecmp(system_charset_info, item_field->field_name,
field_name) &&
@@ -2157,10 +2160,12 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
found= li.ref();
*counter= i;
+ if (db_name)
+ break; // Perfect match
}
}
else if (!my_strcasecmp(system_charset_info, item_field->name,
- field_name))
+ field_name))
{
/*
If table name was not given we should scan through aliases
@@ -2230,7 +2235,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
if (found)
return found;
- else if (report_error != REPORT_EXCEPT_NOT_FOUND)
+ if (report_error != REPORT_EXCEPT_NOT_FOUND)
{
if (report_error == REPORT_ALL_ERRORS)
my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0),