My Project
Public Member Functions | Protected Types | Protected Member Functions
Sql_cmd_truncate_table Class Reference

#include <sql_truncate.h>

Inheritance diagram for Sql_cmd_truncate_table:
Sql_cmd Sql_alloc

List of all members.

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 Types

enum  truncate_result { TRUNCATE_OK = 0, TRUNCATE_FAILED_BUT_BINLOG, TRUNCATE_FAILED_SKIP_BINLOG }

Protected Member Functions

bool lock_table (THD *, TABLE_LIST *, bool *)
enum truncate_result handler_truncate (THD *, TABLE_LIST *, bool)
bool truncate_table (THD *, TABLE_LIST *)

Detailed Description

Sql_cmd_truncate_table represents the TRUNCATE statement.


Constructor & Destructor Documentation

Constructor, used to represent a TRUNCATE statement.


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.

enum Sql_cmd_truncate_table::truncate_result Sql_cmd_truncate_table::handler_truncate ( THD *  thd,
TABLE_LIST table_ref,
bool  is_tmp_table 
) [protected]

Truncate table via the handler method.

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.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines