1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

SQL: truncate syntax and privilege [closes #229]

This commit is contained in:
Eugene Kosov
2017-09-08 10:22:24 +03:00
committed by GitHub
parent 904b69cd9e
commit a49239b57a
46 changed files with 378 additions and 448 deletions

View File

@ -495,9 +495,12 @@ bool Sql_cmd_truncate_table::execute(THD *thd)
TABLE_LIST *table= thd->lex->select_lex.table_list.first;
DBUG_ENTER("Sql_cmd_truncate_table::execute");
DBUG_ASSERT(table);
if (table->vers_conditions)
{
if (check_one_table_access(thd, DELETE_VERSIONING_ROWS_ACL, table))
DBUG_RETURN(res);
DBUG_RETURN(mysql_delete(thd, table, NULL, NULL, -1, 0, NULL));
}
if (check_one_table_access(thd, DROP_ACL, table))
DBUG_RETURN(res);