diff options
author | malff@lambda.hsd1.co.comcast.net. <> | 2007-10-15 19:15:38 -0600 |
---|---|---|
committer | malff@lambda.hsd1.co.comcast.net. <> | 2007-10-15 19:15:38 -0600 |
commit | 99a270ba0f86ed5a163b7f570a0808eb6e4eb8cb (patch) | |
tree | d1de33da80416d5164aaff37fe2c462572ff761d /mysql-test/t/sp-error.test | |
parent | abdd328374de2d2540849c3fe88d8193604ac850 (diff) | |
download | mariadb-git-99a270ba0f86ed5a163b7f570a0808eb6e4eb8cb.tar.gz |
Bug#28318 (CREATE FUNCTION (UDF) requires a schema) -- part II
The root cause of the issue was that the CREATE FUNCTION grammar,
for User Defined Functions, was using the sp_name rule.
The sp_name rule is intended for fully qualified stored procedure names,
like either ident.ident, or just ident but with a default database
implicitly selected.
A UDF does not have a fully qualified name, only a name (ident), and should
not use the sp_name grammar fragment during parsing.
The fix is to re-organize the CREATE FUNCTION grammar, to better separate:
- creating UDF (no definer, can have AGGREGATE, simple ident)
- creating Stored Functions (definer, no AGGREGATE, fully qualified name)
With the test case provided, another issue was exposed which is also fixed:
the DROP FUNCTION statement was using sp_name and also failing when no database
is implicitly selected, when droping UDF functions.
The fix is also to change the grammar so that DROP FUNCTION works with
both the ident.ident syntax (to drop a stored function), or just the ident
syntax (to drop either a UDF or a Stored Function, in the current database)
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r-- | mysql-test/t/sp-error.test | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index a1abf4852b0..8133a2271a1 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1744,7 +1744,7 @@ drop procedure bug15091; drop function if exists bug16896; --enable_warnings ---error ER_SP_NO_AGGREGATE +--error ER_PARSE_ERROR create aggregate function bug16896() returns int return 1; @@ -2099,7 +2099,10 @@ DROP DATABASE IF EXISTS mysqltest; CREATE DATABASE mysqltest; USE mysqltest; DROP DATABASE mysqltest; ---error ER_PARSE_ERROR +# Both ER_SP_DOES_NOT_EXIST and ER_PARSE_ERROR are valid here, +# the result is implementation dependent: +# See Bug#29816 for details +--error ER_SP_DOES_NOT_EXIST SELECT inexistent(), 1 + ,; --error ER_SP_DOES_NOT_EXIST SELECT inexistent(); |