diff options
author | Marc Alff <marc.alff@sun.com> | 2010-02-23 11:43:26 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2010-02-23 11:43:26 -0700 |
commit | e96932f49ec2840cb1665f71fdb316464e5be3bc (patch) | |
tree | 5ee3669bcedd4780871ead9ac02ce6be6f3a7d0c /mysql-test/t/udf.test | |
parent | 1dd2f90faf79eb1b194c9af0cde987c8a7b3058f (diff) | |
download | mariadb-git-e96932f49ec2840cb1665f71fdb316464e5be3bc.tar.gz |
Bug#31767 DROP FUNCTION name resolution
Backport to 5.5.99
Diffstat (limited to 'mysql-test/t/udf.test')
-rw-r--r-- | mysql-test/t/udf.test | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 7e383ce69fa..9bf872fa466 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -436,6 +436,75 @@ SELECT * FROM t2 WHERE a = sequence(); DROP FUNCTION sequence; DROP TABLE t1,t2; +# +# Bug#31767 (DROP FUNCTION name resolution) +# + +--disable_warnings +drop function if exists test.metaphon; +drop function if exists metaphon; +--enable_warnings + +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; + +select metaphon("Hello"); + +# The UDF should not be dropped +drop function if exists test.metaphon; + +select metaphon("Hello"); + +drop function metaphon; + +CREATE FUNCTION test.metaphon(a TEXT) RETURNS TEXT return "This is a SF"; + +create database db_31767; +use db_31767; + +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; + +use test; + +# Uses the UDF +select metaphon("Hello"); + +# Uses the SF +select test.metaphon("Hello"); + +# Should drop the UDF, resolving the name the same way select does. +drop function metaphon; + +# Should call the SF +select metaphon("Hello"); + +# Drop the SF +drop function metaphon; + +# Change the current database to none. +use db_31767; +drop database db_31767; + +drop function if exists no_such_func; + +--error ER_SP_DOES_NOT_EXIST +drop function no_such_func; + +drop function if exists test.no_such_func; + +--error ER_SP_DOES_NOT_EXIST +drop function test.no_such_func; + +--error ER_NO_DB_ERROR +drop procedure if exists no_such_proc; + +--error ER_NO_DB_ERROR +drop procedure no_such_proc; + +use test; + + --echo # --echo # Bug#46259: 5.0.83 -> 5.1.36, query doesn't work --echo # |