| 1 |
RESET MASTER; |
| 2 |
# |
| 3 |
# USE-CASE 1 - rollback empty transaction as first statement and GTID_NEXT |
| 4 |
# set to autotmatic: |
| 5 |
# |
| 6 |
include/save_binlog_position.inc |
| 7 |
# |
| 8 |
# S1. Set GTID_NEXT to 'AUTOMATIC'. |
| 9 |
# |
| 10 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 11 |
# |
| 12 |
# S2. Start and end an XA transaction. |
| 13 |
# |
| 14 |
XA START 'trx'; |
| 15 |
XA END 'trx'; |
| 16 |
# |
| 17 |
# S3. Rollback the XA transaction. |
| 18 |
# |
| 19 |
XA ROLLBACK 'trx'; |
| 20 |
# |
| 21 |
# S4. Check binlog for related event (should not be found). |
| 22 |
# |
| 23 |
include/save_binlog_position.inc |
| 24 |
include/assert.inc [Empty transaction, binlog position is the same] |
| 25 |
# |
| 26 |
# S5. Check for an unchanged GTID_EXECUTED set. |
| 27 |
# |
| 28 |
include/assert.inc [GTID_EXECUTED has not changed] |
| 29 |
# |
| 30 |
# USE-CASE 2 - rollback empty transaction as first statement and GTID_NEXT |
| 31 |
# set to specific UUID: |
| 32 |
# |
| 33 |
include/save_binlog_position.inc |
| 34 |
# |
| 35 |
# S1. Set GTID_NEXT to a specific UUID. |
| 36 |
# |
| 37 |
SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'; |
| 38 |
# |
| 39 |
# S2. Start and end an XA transaction. |
| 40 |
# |
| 41 |
XA START 'trx'; |
| 42 |
XA END 'trx'; |
| 43 |
# |
| 44 |
# S3. Rollback the XA transaction. |
| 45 |
# |
| 46 |
XA ROLLBACK 'trx'; |
| 47 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 48 |
# |
| 49 |
# S4. Check binlog for related event (should not be found). |
| 50 |
# |
| 51 |
include/save_binlog_position.inc |
| 52 |
include/assert.inc [Empty transaction, binlog position is the same] |
| 53 |
# |
| 54 |
# S5. Check GTID_EXECUTED for the specific UUID (should not be found). |
| 55 |
# |
| 56 |
include/assert.inc [Transaction is NOT present in GTID_EXECUTED] |
| 57 |
# |
| 58 |
# USE-CASE 3 - start with GTID_NEXT set to a specific UUID and rollback empty |
| 59 |
# transaction after XA COMMIT ... ONE PHASE and GTID_NEXT set to a specific |
| 60 |
# UUID: |
| 61 |
# |
| 62 |
# |
| 63 |
# S1. Set GTID_NEXT to a specific UUID. |
| 64 |
# |
| 65 |
SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2'; |
| 66 |
# |
| 67 |
# S2. Start and end an XA transaction. |
| 68 |
# |
| 69 |
XA START 'trx'; |
| 70 |
XA END 'trx'; |
| 71 |
# |
| 72 |
# S3. Commit the XA transaction with 'XA COMMIT ... ONE PHASE'. |
| 73 |
# |
| 74 |
XA COMMIT 'trx' ONE PHASE; |
| 75 |
include/save_binlog_position.inc |
| 76 |
# |
| 77 |
# S4. Set GTID_NEXT to a specific UUID. |
| 78 |
# |
| 79 |
SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3'; |
| 80 |
# |
| 81 |
# S5. Start and end an XA transaction. |
| 82 |
# |
| 83 |
XA START 'trx'; |
| 84 |
XA END 'trx'; |
| 85 |
# |
| 86 |
# S6. Rollback the XA transaction. |
| 87 |
# |
| 88 |
XA ROLLBACK 'trx'; |
| 89 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 90 |
# |
| 91 |
# S7. Check binlog for related event (should not be found). |
| 92 |
# |
| 93 |
include/save_binlog_position.inc |
| 94 |
include/assert.inc [Empty transaction, binlog position is the same] |
| 95 |
# |
| 96 |
# S8. Check GTID_EXECUTED for the specific UUID (should not be found). |
| 97 |
# |
| 98 |
include/assert.inc [Transaction is NOT present in GTID_EXECUTED] |
| 99 |
# |
| 100 |
# USE-CASE 4 - start with GTID_NEXT set to 'AUTOMATIC' and rollback empty |
| 101 |
# transaction after XA COMMIT ... ONE PHASE and GTID_NEXT set to a specific |
| 102 |
# UUID: |
| 103 |
# |
| 104 |
# |
| 105 |
# S1. Set GTID_NEXT to 'AUTOMATIC'. |
| 106 |
# |
| 107 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 108 |
# |
| 109 |
# S2. Start and end an XA transaction. |
| 110 |
# |
| 111 |
XA START 'trx'; |
| 112 |
XA END 'trx'; |
| 113 |
# |
| 114 |
# S3. Commit the XA transaction with 'XA COMMIT ... ONE PHASE'. |
| 115 |
# |
| 116 |
XA COMMIT 'trx' ONE PHASE; |
| 117 |
include/save_binlog_position.inc |
| 118 |
# |
| 119 |
# S4. Set GTID_NEXT to a specific UUID. |
| 120 |
# |
| 121 |
SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:4'; |
| 122 |
# |
| 123 |
# S5. Start and end an XA transaction. |
| 124 |
# |
| 125 |
XA START 'trx'; |
| 126 |
XA END 'trx'; |
| 127 |
# |
| 128 |
# S6. Rollback the XA transaction. |
| 129 |
# |
| 130 |
XA ROLLBACK 'trx'; |
| 131 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 132 |
# |
| 133 |
# S7. Check binlog for related event (should not be found). |
| 134 |
# |
| 135 |
include/save_binlog_position.inc |
| 136 |
include/assert.inc [Empty transaction, binlog position is the same] |
| 137 |
# |
| 138 |
# S8. Check GTID_EXECUTED for the specific UUID (should not be found). |
| 139 |
# |
| 140 |
include/assert.inc [Transaction is NOT present in GTID_EXECUTED] |
| 141 |
# |
| 142 |
# USE-CASE 5 - rollback empty transaction after XA PREPARE and XA COMMIT and |
| 143 |
# GTID_NEXT set to a specific UUID: |
| 144 |
# |
| 145 |
# |
| 146 |
# S1. Set GTID_NEXT to 'AUTOMATIC'. |
| 147 |
# |
| 148 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 149 |
# |
| 150 |
# S2. Start and end an XA transaction. |
| 151 |
# |
| 152 |
XA START 'trx'; |
| 153 |
XA END 'trx'; |
| 154 |
# |
| 155 |
# S3. Commit the XA transaction with 'XA PREPARE' and 'XA COMMIT'. |
| 156 |
# |
| 157 |
XA PREPARE 'trx'; |
| 158 |
XA COMMIT 'trx'; |
| 159 |
include/save_binlog_position.inc |
| 160 |
# |
| 161 |
# S4. Set GTID_NEXT to a specific UUID. |
| 162 |
# |
| 163 |
SET @@SESSION.GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:5'; |
| 164 |
# |
| 165 |
# S5. Start and end an XA transaction. |
| 166 |
# |
| 167 |
XA START 'trx'; |
| 168 |
XA END 'trx'; |
| 169 |
# |
| 170 |
# S6. Rollback the XA transaction. |
| 171 |
# |
| 172 |
XA ROLLBACK 'trx'; |
| 173 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 174 |
# |
| 175 |
# S7. Check binlog for related event (should not be found). |
| 176 |
# |
| 177 |
include/save_binlog_position.inc |
| 178 |
include/assert.inc [Empty transaction, binlog position is the same] |
| 179 |
# |
| 180 |
# S8. Check GTID_EXECUTED for the specific UUID (should not be found). |
| 181 |
# |
| 182 |
include/assert.inc [Transaction is NOT present in GTID_EXECUTED] |
| 183 |
# |
| 184 |
# USE-CASE 6 - ensure that non-empty XA transactions are logged and |
| 185 |
# GITD-executed even if they are rolled back with XA ROLLBACK: |
| 186 |
# |
| 187 |
# |
| 188 |
# S1. Create a table |
| 189 |
# |
| 190 |
CREATE TABLE t (a INT); |
| 191 |
# |
| 192 |
# S2. Set GTID_NEXT to a 'AUTOMATIC'. |
| 193 |
# |
| 194 |
SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; |
| 195 |
# |
| 196 |
# S3. Start an XA transaction. |
| 197 |
# |
| 198 |
XA START 'trx'; |
| 199 |
# |
| 200 |
# s4. Insert values into created table. |
| 201 |
# |
| 202 |
INSERT INTO t VALUES (1), (2), (3); |
| 203 |
# |
| 204 |
# S5. End the XA transaction. |
| 205 |
# |
| 206 |
XA END 'trx'; |
| 207 |
# |
| 208 |
# S6. Prepare the XA transaction. |
| 209 |
# |
| 210 |
XA PREPARE 'trx'; |
| 211 |
# |
| 212 |
# S7. Rollback the XA transaction. |
| 213 |
# |
| 214 |
XA ROLLBACK 'trx'; |
| 215 |
# |
| 216 |
# S8. Check binlog for related event (should be found). |
| 217 |
# |
| 218 |
include/assert_binlog_events.inc [Gtid/SET.* # Query/use.* # Gtid/SET.* # Query/XA START.* # Table_map/.* # Write_rows/.* # Query/XA END.* # XA_prepare/XA PREPARE.* # Gtid/SET.* # Query/XA ROLLBACK.*] |
| 219 |
# |
| 220 |
# S9. Check GTID_EXECUTED for the executed UUID (should be found). |
| 221 |
# |
| 222 |
include/assert.inc [Transaction is present in GTID_EXECUTED] |
| 223 |
DROP TABLE t; |