diff options
author | unknown <malff@lambda.hsd1.co.comcast.net.> | 2007-10-16 20:47:08 -0600 |
---|---|---|
committer | unknown <malff@lambda.hsd1.co.comcast.net.> | 2007-10-16 20:47:08 -0600 |
commit | 84984f9111bf49418782eaa21b2d8cde41998eba (patch) | |
tree | 87f5726747166bd6e5b9054924de1bf12f852fb8 /sql/item_create.cc | |
parent | 1dc0efc606bf7f66402e7f9728b7e4a0a1fd82ec (diff) | |
download | mariadb-git-84984f9111bf49418782eaa21b2d8cde41998eba.tar.gz |
Manual merge of 5.0-runtime to 5.1-runtime
mysql-test/r/sp-error.result:
Manual merge
mysql-test/r/sp.result:
Manual merge
mysql-test/r/udf.result:
Manual merge
mysql-test/t/sp.test:
Manual merge
mysql-test/t/udf.test:
Manual merge
sql/item_create.cc:
Manual merge
sql/sp_head.cc:
Manual merge
sql/sql_yacc.yy:
Manual merge
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 19 |
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; |