Current Path : /home/usr.opt/mysql57/mysql-test/suite/sys_vars/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : /home/usr.opt/mysql57/mysql-test/suite/sys_vars/t/gtid_mode_basic.test |
--source include/not_embedded.inc --source include/not_gtid_enabled.inc # default value RESET MASTER; SET @start_global_value = @@global.gtid_mode; SELECT @start_global_value; SET @start_enforce_gtid_consistency= @@global.enforce_gtid_consistency; SET @@global.enforce_gtid_consistency = ON; # # exists as global only # select @@global.gtid_mode; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.gtid_mode; --error ER_GLOBAL_VARIABLE set gtid_mode = @start_global_value; --error ER_GLOBAL_VARIABLE set @@session.gtid_mode = @start_global_value; show global variables like 'gtid_mode'; show session variables like 'gtid_mode'; --disable_warnings select * from information_schema.global_variables where variable_name='gtid_mode'; select * from information_schema.session_variables where variable_name='gtid_mode'; --enable_warnings # # show that it is settable and can only change at most one step at a time # set global gtid_mode = OFF; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = ON_PERMISSIVE; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = ON; set global gtid_mode = OFF_PERMISSIVE; set global gtid_mode = OFF_PERMISSIVE; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = ON; set global gtid_mode = ON_PERMISSIVE; set global gtid_mode = ON_PERMISSIVE; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = OFF; set global gtid_mode = ON; set global gtid_mode = ON; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = OFF; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = OFF_PERMISSIVE; set global gtid_mode = ON_PERMISSIVE; set global gtid_mode = OFF_PERMISSIVE; set global gtid_mode = OFF; --error ER_WRONG_VALUE_FOR_VAR set global gtid_mode = NULL; select @@global.gtid_mode; set global gtid_mode = default; select @@global.gtid_mode; set global gtid_mode = OFF_PERMISSIVE; set global gtid_mode = default; select @@global.gtid_mode; set global gtid_mode = OFF_PERMISSIVE; set global gtid_mode = ON_PERMISSIVE; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = default; select @@global.gtid_mode; set global gtid_mode = ON; --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME set global gtid_mode = default; select @@global.gtid_mode; --error ER_GLOBAL_VARIABLE set session gtid_mode = ON; # can't set ON when sql_slave_skip_counter > 0 set global gtid_mode = on_permissive; set global sql_slave_skip_counter = 1; --error ER_CANT_SET_GTID_MODE set global gtid_mode = on; set global sql_slave_skip_counter = 0; set global gtid_mode = on; # can set everything except ON when enforce_gtid_consistency!=ON set global gtid_mode = on_permissive; SET @@global.enforce_gtid_consistency = OFF; set global gtid_mode = off_permissive; set global gtid_mode = off; set global gtid_mode = off_permissive; set global gtid_mode = on_permissive; --error ER_CANT_SET_GTID_MODE set global gtid_mode = on; SET @@global.enforce_gtid_consistency = WARN; set global gtid_mode = off_permissive; set global gtid_mode = off; set global gtid_mode = off_permissive; set global gtid_mode = on_permissive; --error ER_CANT_SET_GTID_MODE set global gtid_mode = on; # test gtid_mode changes with autocommit off CREATE TABLE t1 (a INT); SET AUTOCOMMIT = 0; ## Confirm that gtid_mode cannot be changed when a transaction ## is in progress and gtid_next is set to 'UUID:No'. SET SESSION GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'; INSERT INTO t1 VALUES (1); # transaction in progress, gtid_mode variable cannot be changed --error ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION SET GLOBAL GTID_MODE = 'off_permissive'; COMMIT; ## Confirm that gtid_mode cannot be changed when gtid_mode is ## set to 'UUID:No'. SET SESSION GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2'; # GTID_NEXT was set, gtid_mode variable cannot be changed --error ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID SET GLOBAL GTID_MODE = 'off_permissive'; COMMIT; ## Confirm that gtid_mode cannot be changed during an anonymous ## transaction. SET GTID_NEXT = 'ANONYMOUS'; --error ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID SET GLOBAL GTID_MODE = 'off_permissive'; COMMIT; # Set back to default and cleanup SET AUTOCOMMIT = 1; SET SESSION GTID_NEXT = 'AUTOMATIC'; DROP TABLE t1; SET GLOBAL GTID_MODE ='off_permissive'; SET GLOBAL GTID_MODE = 'off'; SET @@global.enforce_gtid_consistency = @start_enforce_gtid_consistency; # # See rpl_gtid_mode.test for a comprehensive test case. #