diff options
author | pem@mysql.com <> | 2003-04-29 12:06:04 +0200 |
---|---|---|
committer | pem@mysql.com <> | 2003-04-29 12:06:04 +0200 |
commit | 35c82164f621f1dbf885e328ef330917aa475ad2 (patch) | |
tree | e70f4a2723bc6ab9c1789b31d7c45773f2233bf4 /sql/sql_lex.cc | |
parent | 7f51b1d3e45b05fe310077217a3a5ef6be782c6e (diff) | |
parent | 6c85c6aa6afa24af80dbbe8f320fbbe9f5f4faa9 (diff) | |
download | mariadb-git-35c82164f621f1dbf885e328ef330917aa475ad2.tar.gz |
Merged 4.1 to 5.0.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 9bc4dfc74e7..e1298957a0f 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -21,6 +21,8 @@ #include "item_create.h" #include <m_ctype.h> #include <hash.h> +#include "sp.h" +#include "sp_head.h" LEX_STRING tmp_table_alias= {(char*) "tmp-table",8}; @@ -109,6 +111,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length) LEX *lex= &thd->lex; lex->thd= thd; lex->next_state=MY_LEX_START; + lex->buf= buf; lex->end_of_query=(lex->ptr=buf)+length; lex->yylineno = 1; lex->select_lex.create_refs=lex->in_comment=0; @@ -121,6 +124,9 @@ LEX *lex_start(THD *thd, uchar *buf,uint length) lex->yacc_yyss=lex->yacc_yyvs=0; lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE); lex->sql_command=SQLCOM_END; + lex->sphead= NULL; + lex->spcont= NULL; + lex->spfuns.empty(); return lex; } @@ -144,6 +150,17 @@ static int find_keyword(LEX *lex, uint len, bool function) lex->yylval->symbol.length=len; return symbol->tok; } + + LEX_STRING ls; + ls.str = (char *)tok; ls.length= len; + if (function && sp_function_exists(current_thd, &ls)) // QQ temp fix + { + lex->safe_to_cache_query= 0; + lex->yylval->lex_str.str= lex->thd->strmake((char*)lex->tok_start, len); + lex->yylval->lex_str.length= len; + return SP_FUNC; + } + #ifdef HAVE_DLOPEN udf_func *udf; if (function && using_udf_functions && (udf=find_udf((char*) tok, len))) |