diff options
author | unknown <bell@sanja.is.com.ua> | 2005-10-28 00:24:13 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-10-28 00:24:13 +0300 |
commit | 4a816ce152105787ed3cd684597c421998c3dbcc (patch) | |
tree | fe93843434a12c6357de38534683f49f8f411744 /sql/sql_parse.cc | |
parent | fd0ed478d3dd5919f3d659bb9b5b915a148941d4 (diff) | |
parent | 24ac4019c5da4dc2aec7ff441a53ca7c47419553 (diff) | |
download | mariadb-git-4a816ce152105787ed3cd684597c421998c3dbcc.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-owner7-5.0
mysql-test/r/information_schema.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_view.cc:
Auto merged
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 33020fccd8e..5b27eafcaff 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5026,8 +5026,13 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, { uint found=0; ulong found_access=0; - TABLE_LIST *org_tables=tables; - for (; tables; tables= tables->next_global) + TABLE_LIST *org_tables= tables; + TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table(); + /* + Iterate tables until first prelocking placeholder (if this query do not + have placeholders first_not_own_table is 0) + */ + for (; tables && tables != first_not_own_table; tables= tables->next_global) { if (tables->schema_table && (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL))) @@ -5038,6 +5043,11 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, information_schema_name.str); return TRUE; } + /* + Register access for view underlying table. + Remove SHOW_VIEW_ACL, because it will be checked during making view + */ + tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); if (tables->derived || tables->schema_table || tables->belong_to_view || (tables->table && (int)tables->table->s->tmp_table) || my_tz_check_n_skip_implicit_tables(&tables, |