mysql5/mysql-5.7.27/mysql-test/suite/sys_vars/t/gtid_purged_basic.test

56 lines
1.5 KiB
Plaintext

--source include/not_embedded.inc
# Clear gtid_purged to make variable settable.
RESET MASTER;
SET @start_global_value = @@global.gtid_purged;
SELECT @start_global_value;
SET @sql_log_bin_start_value = @@session.sql_log_bin;
#
# exists as global only
#
select @@global.gtid_purged;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.gtid_purged;
show global variables like 'gtid_purged';
show session variables like 'gtid_purged';
--disable_warnings
select * from information_schema.global_variables where variable_name='gtid_purged';
select * from information_schema.session_variables where variable_name='gtid_purged';
--enable_warnings
--error ER_WRONG_VALUE_FOR_VAR
set @@global.gtid_purged = NULL;
select @@global.gtid_purged;
--error ER_NO_DEFAULT
set @@global.gtid_purged = default;
select @@global.gtid_purged;
#
# Allowed to write (regardless of GTID_MODE).
#
SET @@global.gtid_purged= '11111111-1111-1111-1111-111111111111:1-2';
SELECT @@global.gtid_purged;
# Not allowed to write when GTID_EXECUTED!='';
--error ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY
SET @@global.gtid_purged= '11111111-1111-1111-1111-111111111111:3';
SELECT @@global.gtid_purged;
RESET MASTER;
# Does not initiate a transaction when autocommit is off
SET AUTOCOMMIT= OFF;
SET @@global.gtid_purged= '11111111-1111-1111-1111-111111111111:4-5';
SET @@session.sql_log_bin= @sql_log_bin_start_value;
SET AUTOCOMMIT= ON;
#
# Cleared by RESET MASTER.
#
RESET MASTER;
SELECT @@global.gtid_purged;
#
# See rpl_gtid_purged_maintained.test for a comprehensive test case.
#