summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-05-27 16:05:29 +0300
committerGeorgi Kodinov <joro@sun.com>2009-05-27 16:05:29 +0300
commitbbe29a00d3ca24d4aa9c8c3b7c3f7bd8bcbd3389 (patch)
tree84a2cbd1035921bbaa22dbb65522b2d16b307602 /sql/item_func.cc
parentcb07978da9a24244cf71d9be86eeb794088f67c7 (diff)
downloadmariadb-git-bbe29a00d3ca24d4aa9c8c3b7c3f7bd8bcbd3389.tar.gz
Bug #38159: Function parsing problem generates misleading error message
Added a more detailed error message on calling an ambiguous missing function.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 46e0f30d94e..6737b8cd1b0 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -5401,6 +5401,14 @@ Item_func_sp::func_name() const
}
+int my_missing_function_error(const LEX_STRING &token, const char *func_name)
+{
+ if (token.length && is_lex_native_function (&token))
+ return my_error(ER_FUNC_INEXISTENT_NAME_COLLISION, MYF(0), func_name);
+ else
+ return my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", func_name);
+}
+
/**
@brief Initialize the result field by creating a temporary dummy table
@@ -5434,7 +5442,7 @@ Item_func_sp::init_result_field(THD *thd)
if (!(m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name,
&thd->sp_func_cache, TRUE)))
{
- my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str);
+ my_missing_function_error (m_name->m_name, m_name->m_qname.str);
context->process_error(thd);
DBUG_RETURN(TRUE);
}