My Project
Public Member Functions
Sql_cmd Class Reference
Inheritance diagram for Sql_cmd:
Sql_alloc Sql_cmd_analyze_table Sql_cmd_check_table Sql_cmd_common_alter_table Sql_cmd_common_signal Sql_cmd_get_diagnostics Sql_cmd_handler_close Sql_cmd_handler_open Sql_cmd_handler_read Sql_cmd_optimize_table Sql_cmd_partition_unsupported Sql_cmd_repair_table Sql_cmd_truncate_table

List of all members.

Public Member Functions

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

Detailed Description

of an SQL command.

This class is an interface between the parser and the runtime. The parser builds the appropriate derived classes of Sql_cmd to represent a SQL statement in the parsed tree. The execute() method in the derived classes of Sql_cmd contain the runtime implementation. Note that this interface is used for SQL statements recently implemented, the code for older statements tend to load the LEX structure with more attributes instead. Implement new statements by sub-classing Sql_cmd, as this improves code modularity (see the 'big switch' in dispatch_command()), and decreases the total size of the LEX structure (therefore saving memory in stored programs). The recommended name of a derived class of Sql_cmd is Sql_cmd_<derived>.

Notice that the Sql_cmd class should not be confused with the Statement class. Statement is a class that is used to manage an SQL command or a set of SQL commands. When the SQL statement text is analyzed, the parser will create one or more Sql_cmd objects to represent the actual SQL commands.


Member Function Documentation

virtual bool Sql_cmd::execute ( THD *  thd) [pure virtual]

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