Debian Codegraph @

mysql-test/suite/rpl_gtid/r/rpl_set_gtid_purge_on_sp.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 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.
5 [connection master]
6 #
7 # 1. We create a table on server 1 for check purposes and extract its id
8 [connection master]
9 CREATE TABLE t1 (a INT PRIMARY KEY);
10 include/sync_slave_sql_with_master.inc
11 #
12 # 2. On the replica create a storage procedure that uses the `root` user
13 # security context to SET GTID_PURGED
14 DROP PROCEDURE IF EXISTS set_gtid_purged_sp;
15 Warnings:
16 Note 1305 PROCEDURE test.set_gtid_purged_sp does not exist
17 CREATE DEFINER = 'root'@'localhost' PROCEDURE set_gtid_purged_sp (IN gtid TEXT)
18 SQL SECURITY DEFINER
19 DETERMINISTIC
20 BEGIN
21 SET GLOBAL gtid_purged = gtid;
22 END|
23 #
24 # 3. Create a user with only EXECUTE privileges.
25 # Make a connection with this user
26 CREATE USER 'no_priv_user'@localhost IDENTIFIED BY '';
27 GRANT EXECUTE ON test.* TO 'no_priv_user'@localhost;
28 [connection no_priv_user_con]
29 #
30 # 4. Use the procedure to set GTID_PURGED.
31 # Check the value was set
32 CALL set_gtid_purged_sp("SOURCE_UUID:2");;
33 include/assert.inc [@@GLOBAL.GTID_PURGED has changed]
34 #
35 # 5. Check replication is working as expected
36 [connection master]
37 INSERT INTO t1 values (2);
38 INSERT INTO t1 values (3);
39 include/sync_slave_sql_with_master.inc
40 include/assert.inc [Only one transaction was replicated]
41 #
42 # 6. Cleanup
43 [connection master]
44 DROP TABLE t1;
45 [connection slave]
46 REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'no_priv_user'@localhost;
47 DROP USER 'no_priv_user'@localhost;
48 DROP PROCEDURE set_gtid_purged_sp;
49 include/rpl_end.inc