|
| 1 | +# ==== PURPOSE ==== |
| 2 | +# |
| 3 | +# This test validates encoding and decoding of the GTID_TAGGED_LOG_EVENT, in |
| 4 | +# particular, encoded value of original commit timestamp |
| 5 | +# |
| 6 | +# ==== REQUIREMENTS ==== |
| 7 | +# |
| 8 | +# When original commit timestamp value differs from immediate commit timestamp, |
| 9 | +# the server shall encode original commit timestamp in the GTID_TAGGED_LOG_EVENT |
| 10 | +# |
| 11 | +# ==== IMPLEMENTATION ==== |
| 12 | +# |
| 13 | +# T1. |
| 14 | +# Test steps: |
| 15 | +# |
| 16 | +# 1. Set up a custom original commit timestamp |
| 17 | +# 2. Execute transaction with a tagged GTID |
| 18 | +# 3. Check with mysqlbinlog that event has the required original commit |
| 19 | +# timestamp value |
| 20 | +# |
| 21 | +# Test pass conditions: |
| 22 | +# - Step 3 |
| 23 | +# |
| 24 | +# ==== REFERENCES ==== |
| 25 | +# |
| 26 | +# Bug#36312880 Gtid_tagged_log_event encodes incorrect value of original commit |
| 27 | +# timestamp |
| 28 | +# |
| 29 | + |
| 30 | +# This test is independent from binlog format |
| 31 | +--source include/have_binlog_format_row.inc |
| 32 | + |
| 33 | +RESET BINARY LOGS AND GTIDS; |
| 34 | + |
| 35 | +--echo |
| 36 | +--echo # T1.1 - T1.2 |
| 37 | +--echo |
| 38 | + |
| 39 | +SET SESSION original_commit_timestamp = 1; |
| 40 | + |
| 41 | +SET GTID_NEXT= "11111111-1111-1111-1111-111111111111:tag:1"; |
| 42 | +CREATE TABLE t1 (a INT); |
| 43 | + |
| 44 | +--echo |
| 45 | +--echo # T1.3 |
| 46 | +--echo |
| 47 | + |
| 48 | +--source include/rpl/save_binlog_file_position.inc |
| 49 | +--let $output_file=$MYSQLTEST_VARDIR/tmp/binlog_gtid_tagged_log_event_encoding.output |
| 50 | +--exec $MYSQL_BINLOG --force-if-open $binlog_fullpath > $output_file |
| 51 | + |
| 52 | +--let $assert_text= Check that original commit timestamp value equals 1 |
| 53 | +--let $assert_file = $output_file |
| 54 | +--let $assert_select = session.original_commit_timestamp=1\* |
| 55 | +--let $assert_count = 1 |
| 56 | +--source include/assert_grep.inc |
| 57 | + |
| 58 | +--let $assert_text= Check that immediate commit timestamp differs from original commit timestamp |
| 59 | +--let $assert_file = $output_file |
| 60 | +--let $assert_select = session.immediate_commit_timestamp=1\* |
| 61 | +--let $assert_count = 0 |
| 62 | +--source include/assert_grep.inc |
| 63 | + |
| 64 | +--echo |
| 65 | +--echo # Clean up |
| 66 | +--echo |
| 67 | + |
| 68 | +SET SESSION original_commit_timestamp = DEFAULT; |
| 69 | +SET GTID_NEXT='AUTOMATIC'; |
| 70 | +DROP TABLE t1; |
| 71 | +--remove_file $output_file |
0 commit comments