summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-12-16 21:33:43 +0100
committerAleksey Midenkov <midenok@gmail.com>2017-12-19 16:35:38 +0300
commit617e108fb6e2bc24e5c9badb94e7d8eaa65d8851 (patch)
treeb7c0bc622483a2abd3b642e194609da625e8d52d /sql/sql_parse.cc
parentee68d019d1e059fa0fcf9e63bd97176dd46582c2 (diff)
downloadmariadb-git-617e108fb6e2bc24e5c9badb94e7d8eaa65d8851.tar.gz
s/TRUNCATE ... TO/DELETE HISTORY FROM ... BEFORE/
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);
}