1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00
Files
mariadb/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result
Alexander Barkov 2dbd26932d MDEV-7283 UDF: CREATE OR REPLACE, CREATE IF NOT EXISTS, DROP IF EXISTS
MDEV-7282 SP: CREATE OR REPLACE, CREATE IF NOT EXISTS
2014-12-15 17:41:15 +04:00

65 lines
1.6 KiB
Plaintext

include/master-slave.inc
[connection master]
CREATE TABLE t1 (id INT);
CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
CALL proc1(@cnt);
SELECT @cnt;
@cnt
0
INSERT INTO t1 VALUES (1), (2), (3);
CALL proc1(@cnt);
SELECT @cnt;
@cnt
3
# Syncing with slave
CALL proc1(@cnt);
SELECT @cnt;
@cnt
3
CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
ERROR 42000: PROCEDURE proc1 already exists
CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
Warnings:
Note 1304 PROCEDURE proc1 already exists
CREATE OR REPLACE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
# Syncing with slave
CALL proc1(@cnt);
SELECT @cnt;
@cnt
3
DROP PROCEDURE proc1;
CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
INSERT INTO t1 VALUES (1), (2), (3);
CALL proc1(@cnt);
SELECT @cnt;
@cnt
6
# Syncing with slave
CALL proc1(@cnt);
SELECT @cnt;
@cnt
6
DROP PROCEDURE proc1;
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
INSERT INTO t1 VALUES (1), (2), (3);
CALL proc1(@cnt);
SELECT @cnt;
@cnt
9
# Syncing with slave
CALL proc1(@cnt);
SELECT @cnt;
@cnt
9
DROP TABLE IF EXISTS t1;
DROP PROCEDURE proc1;
DROP PROCEDURE IF EXISTS proc2;
Warnings:
Note 1305 PROCEDURE test.proc2 does not exist
# Syncing with slave
DROP PROCEDURE proc1;
ERROR 42000: PROCEDURE test.proc1 does not exist
include/rpl_end.inc