summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 8ce028020c2..99a58f5fbf9 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -21,6 +21,9 @@
class Table_ident;
class sql_exchange;
class LEX_COLUMN;
+class sp_head;
+class sp_instr;
+class sp_pcontext;
/*
The following hack is needed because mysql_yacc.cc does not define
@@ -74,6 +77,8 @@ enum enum_sql_command {
SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_TABLE_TYPES, SQLCOM_SHOW_PRIVILEGES,
SQLCOM_HELP, SQLCOM_DROP_USER, SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM,
+ SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL,
+ SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION,
/* This should be the last !!! */
SQLCOM_END
@@ -322,7 +327,7 @@ public:
int exec();
int cleanup();
- friend void mysql_init_query(THD *thd);
+ friend void mysql_init_query(THD *thd, bool lexonly);
friend int subselect_union_engine::exec();
private:
bool create_total_list_n_last_return(THD *thd, st_lex *lex,
@@ -454,7 +459,7 @@ public:
bool test_limit();
- friend void mysql_init_query(THD *thd);
+ friend void mysql_init_query(THD *thd, bool lexonly);
st_select_lex() {}
void make_empty_select()
{
@@ -478,6 +483,7 @@ typedef struct st_lex
SELECT_LEX *current_select;
/* list of all SELECT_LEX */
SELECT_LEX *all_selects_list;
+ uchar *buf; /* The beginning of string, used by SPs */
uchar *ptr,*tok_start,*tok_end,*end_of_query;
char *length,*dec,*change,*name;
char *help_arg;
@@ -539,7 +545,22 @@ typedef struct st_lex
bool in_comment, ignore_space, verbose, simple_alter, no_write_to_binlog;
bool derived_tables, describe;
bool safe_to_cache_query;
- st_lex() {}
+ sp_head *sphead;
+ bool sp_lex_in_use; /* Keep track on lex usage in SPs for error handling */
+ sp_pcontext *spcont;
+ HASH spfuns; /* Called functions */
+
+ st_lex()
+ {
+ bzero((char *)&spfuns, sizeof(spfuns));
+ }
+
+ ~st_lex()
+ {
+ if (spfuns.array.buffer)
+ hash_free(&spfuns);
+ }
+
inline void uncacheable()
{
safe_to_cache_query= 0;
@@ -570,4 +591,4 @@ extern pthread_key(LEX*,THR_LEX);
extern LEX_STRING tmp_table_alias;
-#define current_lex (&current_thd->lex)
+#define current_lex (current_thd->lex)