summaryrefslogtreecommitdiff
path: root/sql/sql_truncate.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-08-16 14:53:30 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-08-16 14:53:30 +0200
commit25ae81f133a1063a7234eb7515f50d9b2e82d1a5 (patch)
treec70fa0c8e6b1e40f9c93c89eed5cb4337b1b681c /sql/sql_truncate.h
parent87f655d52d4e30392f2232b51a7658684db6c5d1 (diff)
downloadmariadb-git-25ae81f133a1063a7234eb7515f50d9b2e82d1a5.tar.gz
Bug#49907: ALTER TABLE ... TRUNCATE PARTITION does not wait for
locks on the table Fixing the partitioning specifics after TRUNCATE TABLE in bug-42643 was fixed. Reorganize of code to decrease the size of the giant switch in mysql_execute_command, and to prepare for future parser reengineering. Moved code into Sql_statement objects. Updated patch according to davi's review comments.
Diffstat (limited to 'sql/sql_truncate.h')
-rw-r--r--sql/sql_truncate.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sql/sql_truncate.h b/sql/sql_truncate.h
index 11c07c7187c..b8b1d3da53d 100644
--- a/sql/sql_truncate.h
+++ b/sql/sql_truncate.h
@@ -20,4 +20,30 @@ struct TABLE_LIST;
bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref);
+/**
+ Truncate_statement represents the TRUNCATE statement.
+*/
+class Truncate_statement : public Sql_statement
+{
+public:
+ /**
+ Constructor, used to represent a ALTER TABLE statement.
+ @param lex the LEX structure for this statement.
+ */
+ Truncate_statement(LEX *lex)
+ : Sql_statement(lex)
+ {}
+
+ ~Truncate_statement()
+ {}
+
+ /**
+ Execute a TRUNCATE statement at runtime.
+ @param thd the current thread.
+ @return false on success.
+ */
+ bool execute(THD *thd);
+};
+
+
#endif