MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sql_cmd_truncate_table Class Reference

#include <sql_truncate.h>

Inheritance diagram for Sql_cmd_truncate_table:
Collaboration diagram for Sql_cmd_truncate_table:

Public Member Functions

 Sql_cmd_truncate_table ()
bool execute (THD *thd)
virtual enum_sql_command sql_command_code () const
 Return the command code for this statement.

Protected Member Functions

bool lock_table (THD *, TABLE_LIST *, bool *)
int handler_truncate (THD *, TABLE_LIST *, bool)
bool truncate_table (THD *, TABLE_LIST *)

Additional Inherited Members

- Static Public Member Functions inherited from Sql_alloc
static void * operator new (size_t size) throw ()
static void * operator new[] (size_t size) throw ()
static void * operator new[] (size_t size, MEM_ROOT *mem_root) throw ()
static void * operator new (size_t size, MEM_ROOT *mem_root) throw ()
static void operator delete (void *ptr, size_t size)
static void operator delete (void *ptr, MEM_ROOT *mem_root)
static void operator delete[] (void *ptr, MEM_ROOT *mem_root)
static void operator delete[] (void *ptr, size_t size)

Detailed Description

Sql_cmd_truncate_table represents the TRUNCATE statement.

Definition at line 24 of file sql_truncate.h.

Constructor & Destructor Documentation

Sql_cmd_truncate_table::Sql_cmd_truncate_table ( )
inline

Constructor, used to represent a TRUNCATE statement.

Definition at line 34 of file sql_truncate.h.

Member Function Documentation

bool Sql_cmd_truncate_table::execute ( THD *  thd)
virtual

Execute a TRUNCATE statement at runtime.

Parameters
thdthe current thread.
Returns
false on success.

Execute a TRUNCATE statement at runtime.

Parameters
thdThe current thread.
Returns
FALSE on success.

Implements Sql_cmd.

Definition at line 509 of file sql_truncate.cc.

Here is the call graph for this function:

int Sql_cmd_truncate_table::handler_truncate ( THD *  thd,
TABLE_LIST table_ref,
bool  is_tmp_table 
)
protected

Truncate table via the handler method.

Definition at line 187 of file sql_truncate.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Sql_cmd_truncate_table::lock_table ( THD *  thd,
TABLE_LIST table_ref,
bool *  hton_can_recreate 
)
protected

Handle locking a base table for truncate.

Definition at line 305 of file sql_truncate.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Sql_cmd_truncate_table::truncate_table ( THD *  thd,
TABLE_LIST table_ref 
)
protected

Optimized delete of all rows by doing a full regenerate of the table. Depending on the storage engine, it can be accomplished through a drop and recreate or via the handler truncate method.

Definition at line 393 of file sql_truncate.cc.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: