1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-7283 UDF: CREATE OR REPLACE, CREATE IF NOT EXISTS, DROP IF EXISTS

MDEV-7282 SP: CREATE OR REPLACE, CREATE IF NOT EXISTS
This commit is contained in:
Alexander Barkov
2014-12-15 17:41:15 +04:00
parent 48ed8ab215
commit 2dbd26932d
23 changed files with 1011 additions and 147 deletions

View File

@@ -0,0 +1,49 @@
--source include/master-slave.inc
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
connection master;
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT metaphon('master');
--error ER_UDF_EXISTS
eval CREATE FUNCTION metaphon RETURNS INT SONAME "$UDF_EXAMPLE_SO";
sync_slave_with_master;
SELECT metaphon('slave');
connection master;
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
DROP FUNCTION IF EXISTS random_function_name;
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--error ER_WRONG_USAGE
eval CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
sync_slave_with_master;
SELECT metaphon('slave');
connection master;
DROP FUNCTION metaphon;
eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--error ER_UDF_EXISTS
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
sync_slave_with_master;
SELECT metaphon('slave');
connection master;
DROP FUNCTION metaphon;
DROP FUNCTION IF EXISTS metaphon;
sync_slave_with_master;
--error ER_SP_DOES_NOT_EXIST
DROP FUNCTION metaphon;
DROP FUNCTION IF EXISTS metaphon;
--source include/rpl_end.inc