summaryrefslogtreecommitdiff
path: root/sql/sql_truncate.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-06-15 18:32:08 +0300
committerMichael Widenius <monty@askmonty.org>2013-06-15 18:32:08 +0300
commit5f1f2fc0e443f098af24d21f7d1ec1a8166a4030 (patch)
tree7b870d0c390c05d6629f4813966e740ea073fcef /sql/sql_truncate.h
parent3143ad589a24ac7581e2195ba0dc13576cb3c9da (diff)
downloadmariadb-git-5f1f2fc0e443f098af24d21f7d1ec1a8166a4030.tar.gz
Applied all changes from Igor and Sanja
Diffstat (limited to 'sql/sql_truncate.h')
-rw-r--r--sql/sql_truncate.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_truncate.h b/sql/sql_truncate.h
index 95a2f35df4f..061c561b8ea 100644
--- a/sql/sql_truncate.h
+++ b/sql/sql_truncate.h
@@ -19,9 +19,9 @@ class THD;
struct TABLE_LIST;
/**
- Truncate_statement represents the TRUNCATE statement.
+ Sql_cmd_truncate_table represents the TRUNCATE statement.
*/
-class Truncate_statement : public Sql_statement
+class Sql_cmd_truncate_table : public Sql_cmd
{
private:
/* Set if a lock must be downgraded after truncate is done. */
@@ -29,14 +29,12 @@ private:
public:
/**
- Constructor, used to represent a ALTER TABLE statement.
- @param lex the LEX structure for this statement.
+ Constructor, used to represent a TRUNCATE statement.
*/
- Truncate_statement(LEX *lex)
- : Sql_statement(lex)
+ Sql_cmd_truncate_table()
{}
- virtual ~Truncate_statement()
+ virtual ~Sql_cmd_truncate_table()
{}
/**
@@ -46,6 +44,11 @@ public:
*/
bool execute(THD *thd);
+ virtual enum_sql_command sql_command_code() const
+ {
+ return SQLCOM_TRUNCATE;
+ }
+
protected:
/** Handle locking a base table for truncate. */
bool lock_table(THD *, TABLE_LIST *, bool *);