~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« 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): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

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;