diff options
author | unknown <evgen@moonbone.local> | 2005-08-10 17:45:00 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-08-10 17:45:00 +0400 |
commit | e66cd71698e033c788adb6364fdf261143fb5601 (patch) | |
tree | 9daa110455c864e4bfbf2f5a8c350de43a71686e /sql/sql_view.h | |
parent | aa337b1d5e0de234458b15d4eeead1ff5df45822 (diff) | |
download | mariadb-git-e66cd71698e033c788adb6364fdf261143fb5601.tar.gz |
Fix bug #11864 non unique names are allowed in subquery
Column names weren't checked for uniqueness for subqueries.
Code for names uniqueness checking used for view creation moved into
separate function named check_duplicate_names(). It's called on
preparation of subqueries to check uniqueness of names. If duplicate names
are found then error is raised.
sql/sql_derived.cc:
Fix bug #11864 non unique names are allowed in subquery
Added check for names uniqueness in select list.
sql/sql_view.cc:
Fix bug #11864 non unique names are allowed in subquery
Code for checking uniqueness of names in item list moved into separate function to make in available for use from other places.
sql/sql_view.h:
Fix bug #11864 non unique names are allowed in subquery
Added check_duplicate_names() function prototype.
mysql-test/t/derived.test:
Fixed test case results after bug fix #11864
Added test case for bug#11864 non unique names are allowed in subquery.
mysql-test/t/select_safe.test:
Fixed test case results after bug fix #11864
mysql-test/r/derived.result:
Added test case for bug #11864 non unique names are allowed in subquery.
Fixed test case results after bug fix #11864
mysql-test/r/select_safe.result:
Fixed test case results after bug fix #11864
Diffstat (limited to 'sql/sql_view.h')
-rw-r--r-- | sql/sql_view.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_view.h b/sql/sql_view.h index 3246dbae383..9d961feb143 100644 --- a/sql/sql_view.h +++ b/sql/sql_view.h @@ -33,5 +33,7 @@ int view_checksum(THD *thd, TABLE_LIST *view); extern TYPELIB updatable_views_with_limit_typelib; +bool check_duplicate_names(List<Item>& item_list, bool gen_unique_view_names); + #define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL) |