1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

0.6: truncate history feature [closes #96]

This commit is contained in:
kevg
2016-12-23 17:05:57 +03:00
committed by Aleksey Midenkov
parent 4c37011582
commit c9e4ac4b72
15 changed files with 301 additions and 29 deletions

View File

@ -26,7 +26,8 @@
#include "sql_truncate.h"
#include "wsrep_mysqld.h"
#include "sql_show.h" //append_identifier()
#include "sql_select.h"
#include "sql_delete.h"
/**
Append a list of field names to a string.
@ -480,7 +481,6 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
DBUG_RETURN(error);
}
/**
Execute a TRUNCATE statement at runtime.
@ -495,6 +495,11 @@ bool Sql_cmd_truncate_table::execute(THD *thd)
TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
DBUG_ENTER("Sql_cmd_truncate_table::execute");
bool truncate_history= thd->lex->current_select->vers_conditions.type !=
FOR_SYSTEM_TIME_UNSPECIFIED;
if (truncate_history)
DBUG_RETURN(mysql_delete(thd, first_table, NULL, NULL, -1, 0, NULL));
if (check_one_table_access(thd, DROP_ACL, first_table))
DBUG_RETURN(res);