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.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index b5cc9604a8f..c7a3c692a6e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -2239,6 +2239,15 @@ public:
void reduce_digest_token(uint token_left, uint token_right);
private:
+
+ enum Ident_mode
+ {
+ GENERAL_KEYWORD_OR_FUNC_LPAREN,
+ QUALIFIED_SPECIAL_FUNC_LPAREN
+ };
+
+ int scan_ident_common(THD *thd, Lex_ident_cli_st *str, Ident_mode mode);
+
/**
Set the echo mode.
@@ -2436,7 +2445,7 @@ public:
}
/** Get the raw query buffer. */
- const char *get_buf()
+ const char *get_buf() const
{
return m_buf;
}
@@ -2448,7 +2457,7 @@ public:
}
/** Get the end of the raw query buffer. */
- const char *get_end_of_query()
+ const char *get_end_of_query() const
{
return m_end_of_query;
}
@@ -2492,7 +2501,7 @@ public:
Get the token end position in the pre-processed buffer,
with trailing spaces removed.
*/
- const char *get_cpp_tok_end_rtrim()
+ const char *get_cpp_tok_end_rtrim() const
{
const char *p;
for (p= m_cpp_tok_end;
@@ -2564,9 +2573,9 @@ private:
bool consume_comment(int remaining_recursions_permitted);
int lex_one_token(union YYSTYPE *yylval, THD *thd);
- int find_keyword(Lex_ident_cli_st *str, uint len, bool function);
+ int find_keyword(Lex_ident_cli_st *str, uint len, bool function) const;
+ int find_keyword_qualified_special_func(Lex_ident_cli_st *str, uint len) const;
LEX_CSTRING get_token(uint skip, uint length);
- int scan_ident_sysvar(THD *thd, Lex_ident_cli_st *str);
int scan_ident_start(THD *thd, Lex_ident_cli_st *str);
int scan_ident_middle(THD *thd, Lex_ident_cli_st *str,
CHARSET_INFO **cs, my_lex_states *);
@@ -3695,12 +3704,24 @@ public:
const Lex_ident_cli_st *var_name,
const Lex_ident_cli_st *field_name);
- Item *make_item_func_replace(THD *thd, Item *org, Item *find, Item *replace);
- Item *make_item_func_substr(THD *thd, Item *a, Item *b, Item *c);
- Item *make_item_func_substr(THD *thd, Item *a, Item *b);
+ static const Schema *
+ find_func_schema_by_name_or_error(const Lex_ident_sys &schema_name,
+ const Lex_ident_sys &func_name);
+ Item *make_item_func_replace(THD *thd,
+ const Lex_ident_cli_st &schema_name,
+ const Lex_ident_cli_st &func_name,
+ Item *org, Item *find, Item *replace);
+ Item *make_item_func_substr(THD *thd,
+ const Lex_ident_cli_st &schema_name,
+ const Lex_ident_cli_st &func_name,
+ const Lex_substring_spec_st &spec);
Item *make_item_func_call_generic(THD *thd, Lex_ident_cli_st *db,
Lex_ident_cli_st *name, List<Item> *args);
Item *make_item_func_call_generic(THD *thd,
+ const Lex_ident_sys &db,
+ const Lex_ident_sys &name,
+ List<Item> *args);
+ Item *make_item_func_call_generic(THD *thd,
Lex_ident_cli_st *db,
Lex_ident_cli_st *pkg,
Lex_ident_cli_st *name,