summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2007-01-15 13:10:07 +0300
committerunknown <kostja@bodhi.local>2007-01-15 13:10:07 +0300
commit408d7752495684425a96c32feaedb4cd865a826a (patch)
tree267e52364d28d1d17e8c9dd45c15c9917ce3be95 /sql/sql_lex.h
parent31e01f0a74dd4988ab0628ff0d1b832a190340fe (diff)
parenta8103a89b4ad39031abd1db242beca1b4332c895 (diff)
downloadmariadb-git-408d7752495684425a96c32feaedb4cd865a826a.tar.gz
Manual merge.
mysql-test/r/sp.result: Auto merged mysql-test/t/sp.test: Auto merged sql/mysql_priv.h: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_list.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h54
1 files changed, 46 insertions, 8 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index a7b162c6062..5731e009cb4 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -686,18 +686,58 @@ typedef class st_select_lex SELECT_LEX;
#define ALTER_CONVERT 1024
#define ALTER_FORCE 2048
-typedef struct st_alter_info
+/**
+ @brief Parsing data for CREATE or ALTER TABLE.
+
+ This structure contains a list of columns or indexes to be created,
+ altered or dropped.
+*/
+
+class Alter_info
{
+public:
List<Alter_drop> drop_list;
List<Alter_column> alter_list;
+ List<Key> key_list;
+ List<create_field> create_list;
uint flags;
enum enum_enable_or_disable keys_onoff;
enum tablespace_op_type tablespace_op;
- st_alter_info(){clear();}
- void clear(){keys_onoff= LEAVE_AS_IS;tablespace_op= NO_TABLESPACE_OP;}
- void reset(){drop_list.empty();alter_list.empty();clear();}
-} ALTER_INFO;
+ Alter_info() :
+ flags(0),
+ keys_onoff(LEAVE_AS_IS),
+ tablespace_op(NO_TABLESPACE_OP)
+ {}
+
+ void reset()
+ {
+ drop_list.empty();
+ alter_list.empty();
+ key_list.empty();
+ create_list.empty();
+ flags= 0;
+ keys_onoff= LEAVE_AS_IS;
+ tablespace_op= NO_TABLESPACE_OP;
+ }
+ /**
+ Construct a copy of this object to be used for mysql_alter_table
+ and mysql_create_table. Historically, these two functions modify
+ their Alter_info arguments. This behaviour breaks re-execution of
+ prepared statements and stored procedures and is compensated by
+ always supplying a copy of Alter_info to these functions.
+ The constructed copy still shares key Key, Alter_drop, create_field
+ and Alter_column elements of the lists - these structures are not
+ modified and thus are not copied.
+
+ @note You need to use check thd->is_fatal_error for out
+ of memory condition after calling this function.
+ */
+ Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root);
+private:
+ Alter_info &operator=(const Alter_info &rhs); // not implemented
+ Alter_info(const Alter_info &rhs); // not implemented
+};
struct st_sp_chistics
{
@@ -883,8 +923,6 @@ typedef struct st_lex : public Query_tables_list
List<String> interval_list;
List<LEX_USER> users_list;
List<LEX_COLUMN> columns;
- List<Key> key_list;
- List<create_field> create_list;
List<Item> *insert_list,field_list,value_list,update_list;
List<List_item> many_values;
List<set_var_base> var_list;
@@ -977,7 +1015,7 @@ typedef struct st_lex : public Query_tables_list
bool safe_to_cache_query;
bool subqueries, ignore;
st_parsing_options parsing_options;
- ALTER_INFO alter_info;
+ Alter_info alter_info;
/* Prepared statements SQL syntax:*/
LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */
/*