Debian Codegraph @

mysql-test/suite/binlog/r/binlog_create_if_not_exists.result

raw
1 #
2 # WL#14722 Support IF NOT EXISTS clause
3 # in CREATE PROCEDURE/FUNCTION/TRIGGER
4 #
5 include/master-slave.inc
6 Warnings:
7 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
8 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
9 [connection master]
10
11 # Create objects on source
12 [On Source]
13 CREATE TABLE t1 (a INT);
14 CREATE PROCEDURE IF NOT EXISTS sp1() BEGIN END;
15 CREATE FUNCTION IF NOT EXISTS sf1() RETURNS INT DETERMINISTIC return 0;
16 CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
17 CREATE TRIGGER IF NOT EXISTS trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN END;
18
19 # Check if objects are created on replica
20 [On Replica]
21 include/sync_slave_sql_with_master.inc
22 SELECT routine_name FROM information_schema.routines WHERE routine_schema = "test";
23 ROUTINE_NAME
24 sf1
25 sp1
26 SELECT name FROM mysql.func WHERE name = 'metaphon';
27 name
28 metaphon
29 SELECT trigger_name FROM information_schema.triggers WHERE trigger_schema = "test";
30 TRIGGER_NAME
31 trg1
32
33 # Drop objects on replica
34 DROP PROCEDURE sp1;
35 DROP FUNCTION sf1;
36 DROP FUNCTION metaphon;
37 DROP TRIGGER trg1;
38
39 # Create objects with IF NOT EXISTS claus when objects already exist on source.
40 # These statements should re-create objects on replica
41 [On Source]
42 CREATE PROCEDURE IF NOT EXISTS sp1() BEGIN END;
43 Warnings:
44 Note 1304 PROCEDURE sp1 already exists
45 CREATE FUNCTION IF NOT EXISTS sf1() RETURNS INT DETERMINISTIC return 0;
46 Warnings:
47 Note 1304 FUNCTION sf1 already exists
48 CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
49 Warnings:
50 Note 1125 Function 'metaphon' already exists
51 CREATE TRIGGER IF NOT EXISTS trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN END;
52 Warnings:
53 Note 4099 Trigger 'trg1' already exists on the table 'test'.'t1'.
54
55 # Check if objects are re-created on replica
56 [On Replica]
57 include/sync_slave_sql_with_master.inc
58 SELECT routine_name FROM information_schema.routines WHERE routine_schema = "test";
59 ROUTINE_NAME
60 sf1
61 sp1
62 SELECT name FROM mysql.func WHERE name = 'metaphon';
63 name
64 metaphon
65 SELECT trigger_name FROM information_schema.triggers WHERE trigger_schema = "test";
66 TRIGGER_NAME
67 trg1
68
69 # Cleanup
70 [On Source]
71 DROP PROCEDURE sp1;
72 DROP FUNCTION sf1;
73 DROP FUNCTION metaphon;
74 DROP TRIGGER trg1;
75 DROP TABLE t1;
76 include/sync_slave_sql_with_master.inc
77 include/rpl_end.inc