diff options
author | unknown <bell@sanja.is.com.ua> | 2005-10-28 00:18:23 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-10-28 00:18:23 +0300 |
commit | 9c6c527c769aaff8cee2fef2b4ae6b4babfcd6fe (patch) | |
tree | 921242ccda92f66e2ac8bfc607ba0dcb1f172286 /sql/item.cc | |
parent | 9a5dd3b41195301967c6ca90d004fdb5e80ec713 (diff) | |
download | mariadb-git-9c6c527c769aaff8cee2fef2b4ae6b4babfcd6fe.tar.gz |
support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787)
mysql-test/r/information_schema.result:
error message changed
mysql-test/r/sp.result:
error message changed
mysql-test/r/sql_mode.result:
fixed test suite
mysql-test/r/view.result:
error message changed
mysql-test/r/view_grant.result:
test of underlying view tables check
mysql-test/t/sql_mode.test:
fixed test suite
mysql-test/t/view_grant.test:
test of underlying view tables check
sql/item.cc:
check of underlying tables privilege added
sql/item.h:
Name the resolution context points to the security context of view (if item belong to the view)
sql/item_func.cc:
a view error hiding for execution of prepared function belonged to a view
fixed checking privileges if stored functions belonds to some view
sql/mysql_priv.h:
refult of derived table processing functions changed to bool
Security_context added as an argument to find_field_in_table()
sql/share/errmsg.txt:
error message fixed
sql/sql_acl.cc:
Storing requested privileges of tables added
View underlying tables privilege check added
sql/sql_base.cc:
View underlying tables privilege check added
sql/sql_cache.cc:
Code cleunup: we should not register underlying tables of view second time
sql/sql_delete.cc:
ancestor -> merge_underlying_list renaming
sql/sql_derived.cc:
refult of derived table processing functions changed to bool
do not give SELECT_ACL for TEMPTABLE views
sql/sql_lex.h:
The comment added
sql/sql_parse.cc:
registration of requested privileges added
sql/sql_prepare.cc:
registration of requested privileges added
sql/sql_update.cc:
manipulation of requested privileges for underlying tables made the same as for table which we are updating
sql/sql_view.cc:
underlying tables of view security check support added
sql/table.cc:
renaming and fixing view preparation methods, methods for checking underlyoing tables security context added
sql/table.h:
storege for reuested privileges added
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sql/item.cc b/sql/item.cc index 3d05cc19c08..785c85c6e86 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3208,8 +3208,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) context->last_name_resolution_table, reference, IGNORE_EXCEPT_NON_UNIQUE, - !any_privileges && - context->check_privileges, + !any_privileges, TRUE)) == not_found_field) { @@ -3271,9 +3270,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) last_name_resolution_table, reference, IGNORE_EXCEPT_NON_UNIQUE, - outer_context-> - check_privileges, - TRUE)) != + TRUE, TRUE)) != not_found_field) { if (from_field) @@ -3348,7 +3345,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) context->last_name_resolution_table, reference, REPORT_ALL_ERRORS, !any_privileges && - context->check_privileges, TRUE); + TRUE, TRUE); } goto error; } @@ -3423,7 +3420,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) We can leave expression substituted from view for next PS/SP rexecution (i.e. do not register this substitution for reverting on cleupup() (register_item_tree_changing())), because this subtree will be - fix_field'ed during setup_tables()->setup_ancestor() (i.e. before + fix_field'ed during setup_tables()->setup_underlying() (i.e. before all other expressions of query, and references on tables which do not present in query will not make problems. @@ -4518,8 +4515,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) last_name_resolution_table, reference, IGNORE_EXCEPT_NON_UNIQUE, - outer_context->check_privileges, - TRUE); + TRUE, TRUE); if (! from_field) goto error; if (from_field == view_ref_found) @@ -5131,7 +5127,7 @@ void Item_trigger_field::setup_field(THD *thd, TABLE *table) set field_idx properly. */ (void)find_field_in_table(thd, table, field_name, (uint) strlen(field_name), - 0, 0, &field_idx); + 0, 0, &field_idx, 0); thd->set_query_id= save_set_query_id; triggers= table->triggers; } |