summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorevgen@sunlight.local <>2006-08-15 21:45:24 +0400
committerevgen@sunlight.local <>2006-08-15 21:45:24 +0400
commitdd9a07706b9c463c9ab887232ef4873f49a39cd5 (patch)
treea81bf82a292cd0862ecfaedcf0c1317a9ccdb0a7 /sql/sql_delete.cc
parent5f3d231f5706d43572a1f90873db6ee98226bfcb (diff)
downloadmariadb-git-dd9a07706b9c463c9ab887232ef4873f49a39cd5.tar.gz
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.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index b608773bf6e..e420022b8a1 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -350,7 +350,7 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
&thd->lex->select_lex.top_join_list,
table_list, conds,
&select_lex->leaf_tables, FALSE,
- DELETE_ACL) ||
+ DELETE_ACL, SELECT_ACL) ||
setup_conds(thd, table_list, select_lex->leaf_tables, conds) ||
setup_ftfuncs(select_lex))
DBUG_RETURN(TRUE);
@@ -413,7 +413,7 @@ bool mysql_multi_delete_prepare(THD *thd)
&thd->lex->select_lex.top_join_list,
lex->query_tables, &lex->select_lex.where,
&lex->select_lex.leaf_tables, FALSE,
- DELETE_ACL))
+ DELETE_ACL, SELECT_ACL))
DBUG_RETURN(TRUE);