| 1 |
################################################################################ |
| 2 |
# |
| 3 |
# Insert a new record. Then delete the same record, in the same tx. |
| 4 |
# Mind any tx errors, ROLLBACK if needed to "equalize" different engines. |
| 5 |
# |
| 6 |
################################################################################ |
| 7 |
|
| 8 |
SET autocommit = 0; |
| 9 |
START TRANSACTION; |
| 10 |
|
| 11 |
# Flag to indicate error (use this to decide if we are going to delete after insert). |
| 12 |
let $error= 0; |
| 13 |
|
| 14 |
--error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT |
| 15 |
eval INSERT INTO t1 (`id`, `int1`, `connection_id`, `is_uncommitted`) |
| 16 |
VALUES (3, 3, CONNECTION_ID(), 1); |
| 17 |
|
| 18 |
--source suite/engines/rr_trx/include/check_for_error_rollback.inc |
| 19 |
|
| 20 |
if(!$error) |
| 21 |
{ |
| 22 |
# Conditional, so skip query log |
| 23 |
--disable_query_log |
| 24 |
--error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT |
| 25 |
DELETE FROM t1 WHERE `pk` = (SELECT @@last_insert_id) AND `id` = 3; |
| 26 |
|
| 27 |
--source suite/engines/rr_trx/include/check_for_error_rollback.inc |
| 28 |
--enable_query_log |
| 29 |
} |
| 30 |
|
| 31 |
COMMIT; |