1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-13 13:01:51 +03:00

s/TRUNCATE ... TO/DELETE HISTORY FROM ... BEFORE/

This commit is contained in:
Sergei Golubchik
2017-12-16 21:33:43 +01:00
committed by Aleksey Midenkov
parent ee68d019d1
commit 617e108fb6
7 changed files with 59 additions and 49 deletions

View File

@ -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);
}