summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2004-09-30 16:28:17 +0400
committerunknown <dlenev@brandersnatch.localdomain>2004-09-30 16:28:17 +0400
commit53edc92cd01c292ebe536070f11c311542c7bb95 (patch)
tree869403a16f8b3c117fed13dae2bac7e2f7ab89b6 /sql/mysql_priv.h
parentccf52b4fd5bd7ae0a418d22f2758cef345b6afa6 (diff)
downloadmariadb-git-53edc92cd01c292ebe536070f11c311542c7bb95.tar.gz
Final solution for bug# 4302 "Ambiguos order by when renamed column is
identical to another in result" According to SQL standard queries like "select t1.a as col from t1, t2 order by a" should return an error if both tables contain field a. mysql-test/r/order_by.result: Updated test to conform SQL-standard. mysql-test/t/order_by.test: Updated test to conform SQL-standard. sql/item.cc: find_item_in_list() has now one more out parameter which is not used in item.cc functions. sql/mysql_priv.h: find_item_in_list(): Added boolean out parameter "unaliased" which indicates that we have found field by its original name and not by its alias in item (select) list. sql/sql_base.cc: find_item_in_list(): Added boolean out parameter "unaliased" which indicates that we have found field by its original name and not by its alias in item (select) list. This means that additional check is required to ensure there will be no ambiguity if we would search for this field in all tables. sql/sql_select.cc: find_order_in_list(): If we have found field in select list by its original name and not by its alias then we should perform additional check to ensure that there will be no ambiguity if we will search for this field in all tables. Also small cleanup.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r--sql/mysql_priv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index e47807dd36e..28aec2f9448 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -705,7 +705,8 @@ enum find_item_error_report_type {REPORT_ALL_ERRORS, REPORT_EXCEPT_NOT_FOUND,
IGNORE_ERRORS};
extern const Item **not_found_item;
Item ** find_item_in_list(Item *item, List<Item> &items, uint *counter,
- find_item_error_report_type report_error);
+ find_item_error_report_type report_error,
+ bool *unaliased);
bool get_key_map_from_key_list(key_map *map, TABLE *table,
List<String> *index_list);
bool insert_fields(THD *thd,TABLE_LIST *tables,