mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -344,7 +344,7 @@ JOIN::prepare(Item ***rref_pointer_array,
|
||||
setup_tables_and_check_access(thd, &select_lex->context, join_list,
|
||||
tables_list, &conds,
|
||||
&select_lex->leaf_tables, FALSE,
|
||||
SELECT_ACL)) ||
|
||||
SELECT_ACL, SELECT_ACL)) ||
|
||||
setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) ||
|
||||
select_lex->setup_ref_array(thd, og_num) ||
|
||||
setup_fields(thd, (*rref_pointer_array), fields_list, 1,
|
||||
|
Reference in New Issue
Block a user