MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sql_cmd Class Reference
Inheritance diagram for Sql_cmd:
Collaboration diagram for Sql_cmd:

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

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

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.

Definition at line 123 of file sql_cmd.h.

Member Function Documentation

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

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