1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
###############################################################################
# Bug#25950554:THE FUNCTION RESET_CONNECTION DOES NOT RESET WRITE SET IN #
# WRITESET_SESSION. #
# #
# Problem: When we do reset_connection which has the same effect as #
# auto-reconnect, the write set session history is not cleared, #
# which in case of auto-reconnect does get cleared. #
# #
# Fix: Reset the write set session history when mysql_reset_connection #
# is called. #
# #
# Steps to reproduce: #
# #
# 1) Set the variable transaction_write_set_extraction to 'XXHASH64' which is #
# necessary to be able to change the value of the variable #
# binlog_transaction_dependency_tracking to WRITESET or WRITESET_SESSION #
# #
# 2) Set the variable binlog_transaction_dependency_tracking to WRITESET for #
# few coming transactions. #
# #
# 3) Create a sample table and do few inserts. #
# #
# 4) Change the value of binlog_transaction_dependency_tracking to #
# WRITESET_SESSION, to check if the write set session history is cleared #
# or not after calling reset_connection. #
# #
# 5) Call reset_connection. #
# #
# 6) Check if the logical timestamp has the correct entry after the reset #
# connection. This will mean that the write set history is cleared after a #
# to reset_connection. #
###############################################################################
--source include/have_binlog_format_row.inc
--let $saved_binlog_transaction_dependency_tracking= `SELECT @@GLOBAL.binlog_transaction_dependency_tracking`
SET GLOBAL binlog_transaction_dependency_tracking= 'WRITESET';
CREATE TABLE t1(id INT, PRIMARY KEY (id));
FLUSH LOGS;
INSERT INTO t1(id) VALUES(1);
INSERT INTO t1(id) VALUES(2);
SET GLOBAL binlog_transaction_dependency_tracking= 'WRITESET_SESSION';
INSERT INTO t1(id) VALUES(3);
INSERT INTO t1(id) VALUES(4);
reset_connection;
--source include/save_binlog_position.inc
INSERT INTO t1(id) VALUES(5);
--let $logical_timestamps= 2 5
--source include/assert_logical_timestamps.inc
# Clean up
--eval SET GLOBAL binlog_transaction_dependency_tracking= $saved_binlog_transaction_dependency_tracking
DROP TABLE t1;
|