summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authormalff@lambda.hsd1.co.comcast.net. <>2007-10-16 20:47:08 -0600
committermalff@lambda.hsd1.co.comcast.net. <>2007-10-16 20:47:08 -0600
commitee3e6d8171221a9a7b18dcaa2f7e6275b20b4e3f (patch)
tree87f5726747166bd6e5b9054924de1bf12f852fb8 /sql/item_create.cc
parenta4c66084a8d746556899088b14b27a83f4f62182 (diff)
downloadmariadb-git-ee3e6d8171221a9a7b18dcaa2f7e6275b20b4e3f.tar.gz
Manual merge of 5.0-runtime to 5.1-runtime
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 12b795e79a1..dc9f6e92884 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -2326,6 +2326,25 @@ Item*
Create_qfunc::create(THD *thd, LEX_STRING name, List<Item> *item_list)
{
LEX_STRING db;
+
+ if (! thd->db && ! thd->lex->sphead)
+ {
+ /*
+ The proper error message should be in the lines of:
+ Can't resolve <name>() to a function call,
+ because this function:
+ - is not a native function,
+ - is not a user defined function,
+ - can not match a qualified (read: stored) function
+ since no database is selected.
+ Reusing ER_SP_DOES_NOT_EXIST have a message consistent with
+ the case when a default database exist, see Create_sp_func::create().
+ */
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
+ "FUNCTION", name.str);
+ return NULL;
+ }
+
if (thd->lex->copy_db_to(&db.str, &db.length))
return NULL;