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