diff options
author | unknown <evgen@sunlight.local> | 2006-08-24 03:05:13 +0400 |
---|---|---|
committer | unknown <evgen@sunlight.local> | 2006-08-24 03:05:13 +0400 |
commit | d0394c70708055af5a5914154b1692ba517115f6 (patch) | |
tree | f5614b67c8787eeeac6c424061e26044361b1a1c /sql/sql_parse.cc | |
parent | e8bb0c9295fd9f1f9df2f16ecf4949ab2b226762 (diff) | |
download | mariadb-git-d0394c70708055af5a5914154b1692ba517115f6.tar.gz |
view.result, view.test:
Corrected test case for the bug#21261
sql_parse.cc:
Corrected fix for bug#21261
mysql-test/t/view.test:
Corrected test case for the bug#21261
mysql-test/r/view.result:
Corrected test case for the bug#21261
sql/sql_parse.cc:
Corrected fix for bug#21261
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 72098fb83e4..0e3bd7934eb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5099,10 +5099,21 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables) return 1; /* Check rights on tables of subselects and implictly opened tables */ - TABLE_LIST *subselects_tables; + TABLE_LIST *subselects_tables, *view= all_tables->view ? all_tables : 0; if ((subselects_tables= all_tables->next_global)) { - if ((check_table_access(thd, SELECT_ACL, subselects_tables, 0))) + /* + Access rights asked for the first table of a view should be the same + as for the view + */ + if (view && subselects_tables->belong_to_view == view) + { + if (check_single_table_access (thd, privilege, subselects_tables)) + return 1; + subselects_tables= subselects_tables->next_global; + } + if (subselects_tables && + (check_table_access(thd, SELECT_ACL, subselects_tables, 0))) return 1; } return 0; |