diff options
author | Georgi Kodinov <joro@sun.com> | 2009-05-27 16:05:29 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-05-27 16:05:29 +0300 |
commit | 80730df7d634e1a620c864d6665d6e66ccad447a (patch) | |
tree | 84a2cbd1035921bbaa22dbb65522b2d16b307602 /sql/sql_lex.cc | |
parent | f54beb2dccb921296a4c0bec1aa45e5dd6e53a69 (diff) | |
download | mariadb-git-80730df7d634e1a620c864d6665d6e66ccad447a.tar.gz |
Bug #38159: Function parsing problem generates misleading error message
Added a more detailed error message on calling an ambiguous missing function.
mysql-test/r/ps.result:
Bug #38159: fixed existing tests
mysql-test/r/sp-error.result:
Bug #38159: test case
mysql-test/t/ps.test:
Bug #38159: fixed existing tests
mysql-test/t/sp-error.test:
Bug #38159: test case
sql/item_func.cc:
Bug #38159: generate more detailed error message
sql/share/errmsg.txt:
Bug #38159: add a more detailed error message
sql/sql_derived.cc:
Bug #38159: treat the detailed error message the same way as the
generic one
sql/sql_lex.cc:
Bug #38159:
- detect if the token is ambiguous and print the appropriate error.
- backport is_lex_native_function() from 5.1
sql/sql_lex.h:
Bug #38159: detect if the token is ambiguous and print the appropriate error.
sql/sql_yacc.yy:
Bug #38159: generate more detailed error message
sql/table.cc:
Bug #38159: treat the detailed error message the same way as the
generic one
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 436f41dd209..e7c87527d78 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -265,6 +265,22 @@ bool is_keyword(const char *name, uint len) return get_hash_symbol(name,len,0)!=0; } +/** + Check if name is a sql function + + @param name checked name + + @return is this a lex native function or not + @retval 0 name is a function + @retval 1 name isn't a function +*/ + +bool is_lex_native_function(const LEX_STRING *name) +{ + DBUG_ASSERT(name != NULL); + return (get_hash_symbol(name->str, (uint) name->length, 1) != 0); +} + /* make a copy of token before ptr and set yytoklen */ static LEX_STRING get_token(Lex_input_stream *lip, uint skip, uint length) |