From a23d1792bc48c55eb8bee2f3aa947b9599ade190 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Aug 2006 21:45:24 +0400 Subject: Fixed bug#21261: Wrong access rights was required for an insert into a view SELECT right instead of INSERT right was required for an insert into to a view. This wrong behaviour appeared after the fix for bug #20989. Its intention was to ask only SELECT right for all tables except the very first for a complex INSERT query. But that patch has done it in a wrong way and lead to asking a wrong access right for an insert into a view. The setup_tables_and_check_access() function now accepts two want_access parameters. One will be used for the first table and the second for other tables. mysql-test/t/view.test: Added a test case for bug#21261: Wrong access rights was required for an insert into a view mysql-test/r/view.result: Added a test case for bug#21261: Wrong access rights was required for an insert into a view sql/sql_update.cc: Fixed bug#21261: Wrong access rights was required for an insert into a view Modified to use updated setup_tables_and_check_access() function. sql/sql_select.cc: Fixed bug#21261: Wrong access rights was required for an insert into a view Modified to use updated setup_tables_and_check_access() function. sql/sql_load.cc: Fixed bug#21261: Wrong access rights was required for an insert into a view Modified to use updated setup_tables_and_check_access() function. sql/sql_insert.cc: Fixed bug#21261: Wrong access rights was required for an insert into a view Modified to use updated setup_tables_and_check_access() function. sql/sql_delete.cc: Fixed bug#21261: Wrong access rights was required for an insert into a view Modified to use updated setup_tables_and_check_access() function. sql/sql_base.cc: Fixed bug#21261: Wrong access rights was required for an insert into a view The setup_tables_and_check_access() function now accepts two want_access parameters. One will be used for the first table and the second for other tables. sql/mysql_priv.h: Fixed bug#21261: Wrong access rights was required for an insert into a view The setup_tables_and_check_access() function now accepts two want_access parameters. --- sql/sql_update.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_update.cc') diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 9a207845893..84b22c56cf9 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -627,7 +627,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, &select_lex->top_join_list, table_list, conds, &select_lex->leaf_tables, - FALSE, UPDATE_ACL) || + FALSE, UPDATE_ACL, SELECT_ACL) || setup_conds(thd, table_list, select_lex->leaf_tables, conds) || select_lex->setup_ref_array(thd, order_num) || setup_order(thd, select_lex->ref_pointer_array, @@ -722,7 +722,7 @@ reopen_tables: &lex->select_lex.top_join_list, table_list, &lex->select_lex.where, &lex->select_lex.leaf_tables, FALSE, - UPDATE_ACL)) + UPDATE_ACL, SELECT_ACL)) DBUG_RETURN(TRUE); if (setup_fields_with_no_wrap(thd, 0, *fields, 1, 0, 0)) -- cgit v1.2.1