summaryrefslogtreecommitdiff
path: root/sql/sql_cmd.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_cmd.h')
-rw-r--r--sql/sql_cmd.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h
index 9583e015499..c237bb9270a 100644
--- a/sql/sql_cmd.h
+++ b/sql/sql_cmd.h
@@ -102,6 +102,31 @@ enum enum_sql_command {
SQLCOM_END
};
+
+class Storage_engine_name
+{
+protected:
+ LEX_CSTRING m_storage_engine_name;
+public:
+ Storage_engine_name()
+ {
+ m_storage_engine_name.str= NULL;
+ m_storage_engine_name.length= 0;
+ }
+ Storage_engine_name(const LEX_CSTRING &name)
+ :m_storage_engine_name(name)
+ { }
+ Storage_engine_name(const LEX_STRING &name)
+ {
+ m_storage_engine_name.str= name.str;
+ m_storage_engine_name.length= name.length;
+ }
+ bool resolve_storage_engine_with_error(THD *thd,
+ handlerton **ha,
+ bool tmp_table);
+};
+
+
/**
@class Sql_cmd - Representation of an SQL command.
@@ -145,6 +170,11 @@ public:
*/
virtual bool execute(THD *thd) = 0;
+ virtual Storage_engine_name *option_storage_engine_name()
+ {
+ return NULL;
+ }
+
protected:
Sql_cmd()
{}
@@ -161,4 +191,15 @@ protected:
}
};
+
+class Sql_cmd_create_table: public Sql_cmd,
+ public Storage_engine_name
+{
+public:
+ enum_sql_command sql_command_code() const { return SQLCOM_CREATE_TABLE; }
+ Storage_engine_name *option_storage_engine_name() { return this; }
+ bool execute(THD *thd);
+};
+
+
#endif // SQL_CMD_INCLUDED