summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorpem@mysql.com <>2003-04-04 13:45:35 +0200
committerpem@mysql.com <>2003-04-04 13:45:35 +0200
commit736e78251ee58f1a7e18dafc0d8ac6a45e3f99fc (patch)
treef4f9ee455be6e05171fe74e04042708e983446b8 /sql/sql_lex.cc
parent3a00dc73e10318964b16a728aa5ccd82a2b86ffe (diff)
parent5c4122d3e08474c873b081d2442b842605447f84 (diff)
downloadmariadb-git-736e78251ee58f1a7e18dafc0d8ac6a45e3f99fc.tar.gz
Merging 4.1 to 5.0.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 88375b9469b..bd1e4afa85b 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;
@@ -122,6 +125,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;
}
@@ -145,6 +151,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)))