summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 3c245eea92b..01b77f49b7d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -9409,10 +9409,18 @@ bool update_precheck(THD *thd, TABLE_LIST *tables)
bool delete_precheck(THD *thd, TABLE_LIST *tables)
{
DBUG_ENTER("delete_precheck");
- if (check_one_table_access(thd, DELETE_ACL, tables))
- DBUG_RETURN(TRUE);
- /* Set privilege for the WHERE clause */
- tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
+ if (tables->vers_conditions)
+ {
+ if (check_one_table_access(thd, DELETE_HISTORY_ACL, tables))
+ DBUG_RETURN(TRUE);
+ }
+ else
+ {
+ if (check_one_table_access(thd, DELETE_ACL, tables))
+ DBUG_RETURN(TRUE);
+ /* Set privilege for the WHERE clause */
+ tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
+ }
DBUG_RETURN(FALSE);
}