mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +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:
54
mysql-test/suite/rpl/t/rpl_create_drop_function.test
Normal file
54
mysql-test/suite/rpl/t/rpl_create_drop_function.test
Normal file
@@ -0,0 +1,54 @@
|
||||
--source include/master-slave.inc
|
||||
|
||||
connection master;
|
||||
|
||||
CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
|
||||
CONCAT('Hello, ', str, '!');
|
||||
|
||||
--error ER_SP_ALREADY_EXISTS
|
||||
CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
|
||||
CONCAT('Hello, ', str, '!');
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
SHOW CREATE FUNCTION hello;
|
||||
|
||||
connection master;
|
||||
|
||||
--error ER_WRONG_USAGE
|
||||
CREATE OR REPLACE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
|
||||
CONCAT('Hello, ', str, '!');
|
||||
|
||||
CREATE OR REPLACE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
|
||||
CONCAT('Hello, ', str, '!');
|
||||
|
||||
SELECT hello('master');
|
||||
sync_slave_with_master;
|
||||
|
||||
SELECT hello('slave');
|
||||
|
||||
connection master;
|
||||
CREATE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
|
||||
CONCAT('Hello, ', str, '!');
|
||||
|
||||
CREATE OR REPLACE FUNCTION bye (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
|
||||
CONCAT('Bye, ', str, '!');
|
||||
|
||||
SELECT hello('master');
|
||||
SELECT bye('master');
|
||||
sync_slave_with_master;
|
||||
|
||||
SELECT hello('slave');
|
||||
SELECT bye('slave');
|
||||
|
||||
connection master;
|
||||
DROP FUNCTION hello;
|
||||
DROP FUNCTION IF EXISTS bye;
|
||||
sync_slave_with_master;
|
||||
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
DROP FUNCTION hello;
|
||||
|
||||
DROP FUNCTION IF EXISTS bye;
|
||||
|
||||
--source include/rpl_end.inc
|
Reference in New Issue
Block a user