diff options
author | Eugene Kosov <claprix@yandex.ru> | 2017-09-08 10:22:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 10:22:24 +0300 |
commit | a49239b57a5e46f118a7ab46b8f298b4f596d6ec (patch) | |
tree | f012430ae1ae6f5175e40d67e3e0facbac5a0a51 /sql/sql_truncate.cc | |
parent | 904b69cd9ed15b0d605b9923439e9a66b5057084 (diff) | |
download | mariadb-git-a49239b57a5e46f118a7ab46b8f298b4f596d6ec.tar.gz |
SQL: truncate syntax and privilege [closes #229]
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r-- | sql/sql_truncate.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index b65818a2716..c428491cfa3 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -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); |