1#ifndef SQL_TRUNCATE_INCLUDED
2#define SQL_TRUNCATE_INCLUDED
A granted metadata lock.
Definition: mdl.h:985
Definition: sql_cmd_ddl.h:29
Sql_cmd_truncate_table represents the TRUNCATE statement.
Definition: sql_truncate.h:44
void cleanup_base(THD *, const handlerton *)
Performs cleanup actions after truncate of a normal (non-temporary) table.
Definition: sql_truncate.cc:399
Sql_cmd_truncate_table()=default
Constructor, used to represent a TRUNCATE statement.
void truncate_base(THD *, Table_ref *)
Optimized delete of all rows by doing a full generate of the base (non-temporary) table.
Definition: sql_truncate.cc:468
bool execute(THD *) override
Execute a TRUNCATE statement at runtime.
Definition: sql_truncate.cc:745
MDL_ticket * m_ticket_downgrade
Set if a lock must be downgraded after truncate is done.
Definition: sql_truncate.h:46
~Sql_cmd_truncate_table() override=default
void cleanup_temporary(THD *, handlerton *, const Table_ref &, Up_table *, const std::string &)
Reopens a temporary table after truncate if supported.
Definition: sql_truncate.cc:422
bool lock_table(THD *, Table_ref *)
Definition: sql_truncate.cc:304
void end_transaction(THD *, bool, bool)
Completes transaction by attempting to binlog and commit if truncate has been successful so far.
Definition: sql_truncate.cc:372
void truncate_temporary(THD *, Table_ref *)
Optimized delete of all rows by doing a full generate of the temporary table.
Definition: sql_truncate.cc:631
bool m_error
Track error status from functions called.
Definition: sql_truncate.h:49
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_truncate.h:61
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_TRUNCATE
Definition: my_sqlcommand.h:55
std::unique_ptr< dd::Table > Up_table
Definition: sql_truncate.h:39
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2734