~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/rr_trx/t/rr_id_3.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;