diff options
author | unknown <kostja@bodhi.local> | 2006-12-12 01:23:30 +0300 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2006-12-12 01:23:30 +0300 |
commit | 3e3990433a0c8ec7cea01274909fdb17024519e8 (patch) | |
tree | 3a662cb0552120a80c60d29abb3b2f97c9d177b2 /sql/sql_lex.h | |
parent | fe84b016e1fd62d92c9f13a1e21784ea8cb200cd (diff) | |
parent | e47ded8114f0b692a2ecf010998edcad46e6c2b3 (diff) | |
download | mariadb-git-3e3990433a0c8ec7cea01274909fdb17024519e8.tar.gz |
Merge bodhi.local:/opt/local/work/mysql-4.1-4968
into bodhi.local:/opt/local/work/mysql-5.0-4968-pull-from-4.1
sql/sql_insert.cc:
Auto merged
mysql-test/r/ps.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
sql/mysql_priv.h:
Manual merge.
sql/sql_class.h:
Manual merge.
sql/sql_lex.cc:
Manual merge.
sql/sql_lex.h:
Manual merge.
sql/sql_list.h:
Manual merge.
sql/sql_parse.cc:
Manual merge.
sql/sql_show.cc:
Manual merge.
sql/sql_table.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 54 |
1 files changed, 46 insertions, 8 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 5f968252cc3..bca1d5e1ba9 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -688,18 +688,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 { @@ -885,8 +925,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; @@ -979,7 +1017,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) */ /* |