Skip to content

Commit 78c835a

Browse files
Tatiana Azundris Nuernbergdahlerlend
Tatiana Azundris Nuernberg
authored andcommitted
WL#15752: Add statement type "DDL" to transaction tracking facility - missing DDL statements
post-push fixes Change-Id: I1d4135d18a6b06b6b76ce56bdabfb35ebc50dada
1 parent 5151820 commit 78c835a

20 files changed

+40
-16
lines changed

mysql-test/suite/group_replication/r/gr_primary_manual_failover_vs_ddl_create_so_function.result

+2-9
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@ include/start_group_replication.inc
1818
############################################################
1919
# 2. Start a DDL statement on server1, but do not let it complete yet.
2020
[connection server_1_1]
21-
SET DEBUG_SYNC= 'execute_command_before_main_switch SIGNAL ddl_running WAIT_FOR ddl_resume';
2221
# The statement to test with that should hold up switching the primary:
23-
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
2422
[connection server1]
25-
SET DEBUG_SYNC= 'now WAIT_FOR ddl_running';
2623

2724
############################################################
2825
# 3. Set server2 as primary. The primary change must wait
2926
# until the DDL statement has completed.
3027
[connection server_1]
31-
SELECT group_replication_set_as_primary("SERVER2_UUID");
3228

3329
############################################################
3430
# 4. Assert that server1 continues to be the primary, as the
@@ -41,9 +37,7 @@ include/assert.inc ['server1 continue to be primary']
4137
############################################################
4238
# 5. Let the DDL statement finish.
4339
[connection server1]
44-
SET DEBUG_SYNC= 'now SIGNAL ddl_resume';
4540
[connection server_1_1]
46-
SET DEBUG_SYNC= 'RESET';
4741

4842
############################################################
4943
# 6. server2 should now be primary.
@@ -60,14 +54,13 @@ include/gr_assert_primary_member.inc
6054
[connection server2]
6155
include/show_relaylog_events.inc [FOR CHANNEL 'group_replication_applier']
6256
Log_name Pos Event_type Server_id End_log_pos Info
63-
server-relay-log-group_replication_applier.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
64-
server-relay-log-group_replication_applier.000002 # Query # # use `test`; CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so'
57+
server-relay-log-group_replication_applier.000002 # Format_desc # # #
58+
server-relay-log-group_replication_applier.000002 # Query # # #
6559

6660
############################################################
6761
# 8. Clean up.
6862
[connection server2]
6963
# The clean-up statement for our earlier test statement:
70-
DROP FUNCTION metaphon;
7164
include/rpl_sync.inc
7265
[connection server1]
7366
include/stop_group_replication.inc

mysql-test/suite/group_replication/r/gr_primary_manual_failover_vs_ddl_drop_so_function.result

-7
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,19 @@ Note #### Storing MySQL user name or password information in the connection meta
1313
[connection server1]
1414
include/start_and_bootstrap_group_replication.inc
1515
# The set-up statement for our later test statement:
16-
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
1716
[connection server2]
1817
include/start_group_replication.inc
1918

2019
############################################################
2120
# 2. Start a DDL statement on server1, but do not let it complete yet.
2221
[connection server_1_1]
23-
SET DEBUG_SYNC= 'execute_command_before_main_switch SIGNAL ddl_running WAIT_FOR ddl_resume';
2422
# The statement to test with that should hold up switching the primary:
25-
DROP FUNCTION metaphon;
2623
[connection server1]
27-
SET DEBUG_SYNC= 'now WAIT_FOR ddl_running';
2824

2925
############################################################
3026
# 3. Set server2 as primary. The primary change must wait
3127
# until the DDL statement has completed.
3228
[connection server_1]
33-
SELECT group_replication_set_as_primary("SERVER2_UUID");
3429

3530
############################################################
3631
# 4. Assert that server1 continues to be the primary, as the
@@ -43,9 +38,7 @@ include/assert.inc ['server1 continue to be primary']
4338
############################################################
4439
# 5. Let the DDL statement finish.
4540
[connection server1]
46-
SET DEBUG_SYNC= 'now SIGNAL ddl_resume';
4741
[connection server_1_1]
48-
SET DEBUG_SYNC= 'RESET';
4942

5043
############################################################
5144
# 6. server2 should now be primary.

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_dcl_grant.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/not_have_privilege_checks_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE USER wl15752
1416
--let $ddl_statement= GRANT SELECT, INSERT, UPDATE, DELETE ON test.* TO wl15752
1517
--let $ddl_cleanup_statement= DROP USER wl15752

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_dcl_revoke.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/not_have_privilege_checks_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE USER wl15752; GRANT SELECT, INSERT, UPDATE, DELETE ON test.* TO wl15752
1416
--let $ddl_statement= REVOKE ALL PRIVILEGES, GRANT OPTION FROM wl15752
1517
--let $ddl_cleanup_statement= DROP USER wl15752

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_alter_event.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 11 HOUR DO SELECT 1
1416
--let $ddl_statement= ALTER EVENT ev1 COMMENT "eventful"
1517
--let $ddl_cleanup_statement= DROP EVENT ev1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_alter_function.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE FUNCTION fun1 () RETURNS VARCHAR(64) RETURN "fun"
1416
--let $ddl_statement= ALTER FUNCTION fun1 COMMENT "it's fun"
1517
--let $ddl_cleanup_statement= DROP FUNCTION fun1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_alter_procedure.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE PROCEDURE proc1(export INT) BEGIN END
1416
--let $ddl_statement= ALTER PROCEDURE proc1 COMMENT 'it procs'
1517
--let $ddl_cleanup_statement= DROP PROCEDURE proc1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_alter_view.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE TABLE t1 (f1 INT, f2 INT); CREATE VIEW v1 AS SELECT f1 FROM t1
1416
--let $ddl_statement= ALTER VIEW v1 AS SELECT f2 FROM t1
1517
--let $ddl_cleanup_statement= DROP VIEW v1; DROP TABLE t1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_create_event.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement=
1416
--let $ddl_statement= CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 11 HOUR DO SELECT 1
1517
--let $ddl_cleanup_statement= DROP EVENT ev1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_create_function.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement=
1416
--let $ddl_statement= CREATE FUNCTION fun1 () RETURNS VARCHAR(64) RETURN "fun"
1517
--let $ddl_cleanup_statement= DROP FUNCTION fun1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_create_procedure.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement=
1416
--let $ddl_statement= CREATE PROCEDURE proc1(export INT) BEGIN END
1517
--let $ddl_cleanup_statement= DROP PROCEDURE proc1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_create_so_function.test

+4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--let $show_binlog_events_mask_columns= 2, 4, 5, 6
14+
1315
--let $ddl_preparation_statement=
1416
--let $ddl_statement= CREATE FUNCTION metaphon RETURNS STRING SONAME '$UDF_EXAMPLE_LIB'
1517
--let $ddl_cleanup_statement= DROP FUNCTION metaphon
18+
--disable_query_log
1619
--source ../include/gr_primary_manual_failover_vs_ddl.inc
20+
--enable_query_log

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_create_trigger.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE TABLE t1 (f1 INT)
1416
--let $ddl_statement= CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @sum=@sum+NEW.f1
1517
--let $ddl_cleanup_statement= DROP TRIGGER tr1; DROP TABLE t1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_create_view.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE TABLE t1 (f1 INT)
1416
--let $ddl_statement= CREATE VIEW v1 AS SELECT f1 FROM t1
1517
--let $ddl_cleanup_statement= DROP VIEW v1; DROP TABLE t1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_drop_event.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 11 HOUR DO SELECT 1
1416
--let $ddl_statement= DROP EVENT ev1
1517
--let $ddl_cleanup_statement=

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_drop_function.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE FUNCTION fun1 () RETURNS VARCHAR(64) RETURN "fun"
1416
--let $ddl_statement= DROP FUNCTION fun1
1517
--let $ddl_cleanup_statement=

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_drop_procedure.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE PROCEDURE proc1(export INT) BEGIN END
1416
--let $ddl_statement= DROP PROCEDURE proc1
1517
--let $ddl_cleanup_statement=

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_drop_so_function.test

+2
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
--let $ddl_preparation_statement= CREATE FUNCTION metaphon RETURNS STRING SONAME '$UDF_EXAMPLE_LIB'
1414
--let $ddl_statement= DROP FUNCTION metaphon
1515
--let $ddl_cleanup_statement=
16+
--disable_query_log
1617
--source ../include/gr_primary_manual_failover_vs_ddl.inc
18+
--enable_query_log

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_drop_trigger.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE TABLE t1 (f1 INT); CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @sum=@sum+NEW.f1
1416
--let $ddl_statement= DROP TRIGGER tr1
1517
--let $ddl_cleanup_statement= DROP TABLE t1

mysql-test/suite/group_replication/t/gr_primary_manual_failover_vs_ddl_drop_view.test

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# the primary. #
1111
#############################################################
1212

13+
--source include/set_privilege_checks_user_as_system_user.inc
14+
1315
--let $ddl_preparation_statement= CREATE TABLE t1 (f1 INT, f2 INT); CREATE VIEW v1 AS SELECT f1 FROM t1
1416
--let $ddl_statement= DROP VIEW v1
1517
--let $ddl_cleanup_statement= DROP TABLE t1

0 commit comments

Comments
 (0)