~vadim-tk/percona-server/percona-5.5.15-galera

« back to all changes in this revision

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

  • Committer: root
  • Date: 2011-09-10 16:37:18 UTC
  • Revision ID: root@r815.office.percona.com-20110910163718-ydh4zj8hcdgoyavb
Porting Galera to 5.5.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
#
 
3
# UPDATE using multiple statements. Subtract a value (4) from one field, then
 
4
# add the same value to another field in the same row.
 
5
#
 
6
# Mind any tx errors, ROLLBACK if needed to "equalize" different engines.
 
7
#
 
8
################################################################################
 
9
 
 
10
SET autocommit = 0;
 
11
START TRANSACTION;
 
12
eval SET @conn_id = CONNECTION_ID(), @thread_id = 0;
 
13
 
 
14
--error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT, ER_CHECKREAD
 
15
UPDATE t1 SET `int1` = `int1` - 4, 
 
16
              `id` = 4,
 
17
              `is_consistent` = 0,
 
18
              `connection_id` = @conn_id,
 
19
              `thread_id` = @thread_id
 
20
    WHERE `pk` = 4;
 
21
 
 
22
--source suite/engines/rr_trx/include/check_for_error_rollback.inc
 
23
 
 
24
--echo *** UPDATEing row with pk = 4 and `int1_key` +=4 if above statement succeeded (query log disabled)...
 
25
 
 
26
if (!$error)
 
27
{
 
28
    # This is conditional, so disable query log to avoid irrelevant diffs.
 
29
    --disable_query_log
 
30
    --error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT, ER_CHECKREAD
 
31
    UPDATE t1 SET `int1_key` = `int1_key` + 4,
 
32
                  `is_consistent` = 1,
 
33
                  `connection_id` = @conn_id,
 
34
                  `thread_id` = @thread_id
 
35
        WHERE `pk` = 4;
 
36
 
 
37
    --source suite/engines/rr_trx/include/check_for_error_rollback.inc
 
38
    --enable_query_log
 
39
}
 
40
 
 
41
COMMIT;