diff options
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 05a4d1d78bf..4bf8cd41aee 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -97,7 +97,7 @@ enum enum_sql_command { SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI, SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO, SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS, - SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES, + SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES, SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER, SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM, SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL, @@ -400,7 +400,7 @@ public: Base class for st_select_lex (SELECT_LEX) & st_select_lex_unit (SELECT_LEX_UNIT) */ -struct st_lex; +struct LEX; class st_select_lex; class st_select_lex_unit; class st_select_lex_node { @@ -470,7 +470,7 @@ public: virtual void set_lock_for_tables(thr_lock_type lock_type) {} friend class st_select_lex_unit; - friend bool mysql_new_select(struct st_lex *lex, bool move_down); + friend bool mysql_new_select(LEX *lex, bool move_down); friend bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, uint flags); private: @@ -590,7 +590,7 @@ public: /* Saved values of the WHERE and HAVING clauses*/ Item::cond_result cond_value, having_value; /* point on lex in which it was created, used in view subquery detection */ - st_lex *parent_lex; + LEX *parent_lex; enum olap_type olap; /* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */ SQL_LIST table_list; @@ -899,7 +899,7 @@ public: enum enum_enable_or_disable keys_onoff; enum tablespace_op_type tablespace_op; List<char> partition_names; - uint no_parts; + uint num_parts; enum_alter_table_change_level change_level; Create_field *datetime_field; bool error_if_not_empty; @@ -909,7 +909,7 @@ public: flags(0), keys_onoff(LEAVE_AS_IS), tablespace_op(NO_TABLESPACE_OP), - no_parts(0), + num_parts(0), change_level(ALTER_TABLE_METADATA_ONLY), datetime_field(NULL), error_if_not_empty(FALSE) @@ -924,7 +924,7 @@ public: flags= 0; keys_onoff= LEAVE_AS_IS; tablespace_op= NO_TABLESPACE_OP; - no_parts= 0; + num_parts= 0; partition_names.empty(); change_level= ALTER_TABLE_METADATA_ONLY; datetime_field= 0; @@ -956,6 +956,9 @@ extern sys_var *trg_new_row_fake_var; enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE, XA_SUSPEND, XA_FOR_MIGRATE}; +extern const LEX_STRING null_lex_str; +extern const LEX_STRING empty_lex_str; + /* Class representing list of all tables used by statement. @@ -964,7 +967,7 @@ enum xa_option_words {XA_NONE, XA_JOIN, XA_RESUME, XA_ONE_PHASE, stored functions/triggers to this list in order to pre-open and lock them. - Also used by st_lex::reset_n_backup/restore_backup_query_tables_list() + Also used by LEX::reset_n_backup/restore_backup_query_tables_list() methods to save and restore this information. */ @@ -1492,9 +1495,13 @@ public: /** TRUE if we're parsing a prepared statement: in this mode - we should allow placeholders and disallow multi-statements. + we should allow placeholders. */ bool stmt_prepare_mode; + /** + TRUE if we should allow multi-statements. + */ + bool multi_statements; /** State of the lexical analyser for comments. */ enum_comment_state in_comment; @@ -1553,7 +1560,7 @@ protected: Constructor. @param lex the LEX structure that represents parts of this statement. */ - Sql_statement(struct st_lex *lex) + Sql_statement(LEX *lex) : m_lex(lex) {} @@ -1578,12 +1585,12 @@ protected: with the minimum set of attributes, instead of a LEX structure that contains the collection of every possible attribute. */ - struct st_lex *m_lex; + LEX *m_lex; }; /* The state of the lex parsing. This is saved in the THD struct */ -typedef struct st_lex : public Query_tables_list +struct LEX: public Query_tables_list { SELECT_LEX_UNIT unit; /* most upper unit */ SELECT_LEX select_lex; /* first SELECT_LEX */ @@ -1833,9 +1840,9 @@ typedef struct st_lex : public Query_tables_list */ bool protect_against_global_read_lock; - st_lex(); + LEX(); - virtual ~st_lex() + virtual ~LEX() { destroy_query_tables_list(); plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements); @@ -1877,7 +1884,7 @@ typedef struct st_lex : public Query_tables_list Is this update command where 'WHITH CHECK OPTION' clause is important SYNOPSIS - st_lex::which_check_option_applicable() + LEX::which_check_option_applicable() RETURN TRUE have to take 'WHITH CHECK OPTION' clause into account @@ -1949,7 +1956,7 @@ typedef struct st_lex : public Query_tables_list } return FALSE; } -} LEX; +}; /** @@ -2040,7 +2047,7 @@ public: }; -struct st_lex_local: public st_lex +struct st_lex_local: public LEX { static void *operator new(size_t size) throw() { |