Server IP : 104.21.38.3 / Your IP : 172.68.164.61 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/sys_vars/t/ |
Upload File : |
############## mysql-test\t\transaction_write_set_extraction_basic.test################## # # # This test checks the basics of setting the variable transaction_write_set_extraction # # # # Variable Name: transaction_write_set_extraction # # Scope: GLOBAL | SESSION # # Access Type: Dynamic # # Data Type: enum # # Default Value: OFF # # Allowed value: OFF / MURMUR32 / XXHASH64 or 0 / 1 / 2 # # # # Description: Test Cases of Dynamic System Variable transaction_write_set_extraction # # that checks the behavior of this variable in the following ways # # * Default Value # # * Valid & Invalid values # # # # This test also verifies : # # # # 1. The server option transaction_write_set_extraction cannot be modified # # inside a multi-statement transaction. # # # # 2. The new server option transaction_write_set_extraction can only be set # # when the binlog format is ROW and fails with other binlog formats. # # # # Note: This var cannot be set also when Group Replication is running. # # This test is done in the group replication suite # # # ######################################################################################### --source include/not_embedded.inc ############################################################# # Save initial value # ############################################################# SET @start_global_value = @@GLOBAL.transaction_write_set_extraction; SELECT @start_global_value; SET @start_session_value = @@SESSION.transaction_write_set_extraction; SELECT @start_session_value; SET @start_global_binlog_format = @@GLOBAL.binlog_format; SELECT @start_global_binlog_format; ##################################################################### # Display the DEFAULT value of transaction_write_set_extraction # ##################################################################### # GLOBAL SETTINGS SET @@GLOBAL.binlog_format= ROW; SET global transaction_write_set_extraction= DEFAULT; SELECT @@global.transaction_write_set_extraction; SET global transaction_write_set_extraction='OFF'; SELECT @@global.transaction_write_set_extraction; SET global transaction_write_set_extraction= 0; SELECT @@global.transaction_write_set_extraction; SET global transaction_write_set_extraction='MURMUR32'; SELECT @@global.transaction_write_set_extraction; SET global transaction_write_set_extraction= 1; SELECT @@global.transaction_write_set_extraction; SET global transaction_write_set_extraction='XXHASH64'; SELECT @@global.transaction_write_set_extraction; SET global transaction_write_set_extraction= 2; SELECT @@global.transaction_write_set_extraction; # SESSION SETTINGS SELECT @@session.transaction_write_set_extraction; SET @@SESSION.binlog_format= ROW; SET session transaction_write_set_extraction=DEFAULT; SELECT @@session.transaction_write_set_extraction; SET session transaction_write_set_extraction='OFF'; SELECT @@session.transaction_write_set_extraction; SET session transaction_write_set_extraction=0; SELECT @@session.transaction_write_set_extraction; SET session transaction_write_set_extraction='MURMUR32'; SELECT @@session.transaction_write_set_extraction; SET session transaction_write_set_extraction=1; SELECT @@session.transaction_write_set_extraction; SET session transaction_write_set_extraction='XXHASH64'; SELECT @@session.transaction_write_set_extraction; SET session transaction_write_set_extraction=2; SELECT @@session.transaction_write_set_extraction; # checking that setting variable to a non existing value raises error # INVALID SESSION SETTINGS --error ER_WRONG_VALUE_FOR_VAR SET session transaction_write_set_extraction='ABC'; SELECT @@session.transaction_write_set_extraction; --error ER_WRONG_VALUE_FOR_VAR SET session transaction_write_set_extraction= 3; SELECT @@session.transaction_write_set_extraction; --error ER_WRONG_VALUE_FOR_VAR SET session transaction_write_set_extraction='1'; SELECT @@session.transaction_write_set_extraction; #################################### # Restore initial value # #################################### SET @@global.transaction_write_set_extraction = @start_global_value; SELECT @@global.transaction_write_set_extraction; SET @@session.transaction_write_set_extraction = @start_session_value; SELECT @@session.transaction_write_set_extraction; SET @@GLOBAL.binlog_format= @start_global_binlog_format; SELECT @@GLOBAL.binlog_format; ##################################################################### # Checking if the value can be set inside a multi-line transaction # ##################################################################### --let $assert_text= The value for transaction_write_set_extraction shoudl be OFF --let $assert_cond= "[SELECT @@SESSION.transaction_write_set_extraction]" = "OFF" --source include/assert.inc CREATE TABLE t1 (i INT PRIMARY KEY); SET @start_session_value = @@SESSION.transaction_write_set_extraction; SELECT @start_session_value; BEGIN; --error ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION SET @@SESSION.transaction_write_set_extraction= MURMUR32; COMMIT; # Inside a trigger. CREATE TABLE t2(c1 INT, c2 INT); delimiter |; eval CREATE TRIGGER tr2 AFTER INSERT ON t2 FOR EACH ROW BEGIN SET @@SESSION.transaction_write_set_extraction= MURMUR32; END| delimiter ;| --error ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION INSERT INTO t2 VALUES (0,0); DROP TABLE t2; SET @@SESSION.transaction_write_set_extraction=MURMUR32; SELECT @@SESSION.transaction_write_set_extraction; SET @@SESSION.transaction_write_set_extraction=OFF; --let $assert_text= The value for transaction_write_set_extraction should be OFF --let $assert_cond= "[SELECT @@SESSION.transaction_write_set_extraction]" = "OFF" --source include/assert.inc ################################################################################ # Check for setting the value for this variable when binlog format is not ROW. # ################################################################################ SET @@SESSION.binlog_format= STATEMENT; --error ER_PREVENTS_VARIABLE_WITHOUT_RBR SET @@SESSION.transaction_write_set_extraction= MURMUR32; SET @@SESSION.binlog_format= MIXED; --error ER_PREVENTS_VARIABLE_WITHOUT_RBR SET @@SESSION.transaction_write_set_extraction= MURMUR32; SET @@SESSION.binlog_format= ROW; SET @@SESSION.transaction_write_set_extraction= MURMUR32; SELECT @@SESSION.transaction_write_set_extraction; SET @@SESSION.transaction_write_set_extraction = @start_session_value; SELECT @@SESSION.transaction_write_set_extraction; SET @@GLOBAL.binlog_format= STATEMENT; --error ER_PREVENTS_VARIABLE_WITHOUT_RBR SET @@GLOBAL.transaction_write_set_extraction= MURMUR32; SET @@GLOBAL.binlog_format= MIXED; --error ER_PREVENTS_VARIABLE_WITHOUT_RBR SET @@GLOBAL.transaction_write_set_extraction= MURMUR32; SET @@GLOBAL.binlog_format= ROW; SET @@GLOBAL.transaction_write_set_extraction= MURMUR32; SELECT @@GLOBAL.transaction_write_set_extraction; SET @@GLOBAL.transaction_write_set_extraction = @start_global_value; SELECT @@GLOBAL.transaction_write_set_extraction; SET @@GLOBAL.binlog_format= @start_global_binlog_format; DROP TABLE t1;