~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/transaction.test

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Tests a number of things related to transactions:
2
 
3
 
# 1. Interaction of more than one engine in a transaction
4
 
# 2. Correct commit and rollback behaviour
5
 
# 3. XA protocol communication and recovery
6
 
 
7
 
--disable_warnings
8
 
DROP TABLE IF EXISTS t1_trx, t1_non_trx;
9
 
--enable_warnings
10
 
 
11
 
SET AUTOCOMMIT= 0;
12
 
 
13
 
CREATE TABLE t1_trx (
14
 
  k VARCHAR(10) NOT NULL
15
 
, v VARCHAR(10) NOT NULL
16
 
, PRIMARY KEY (k)
17
 
) ENGINE=InnoDB;
18
 
 
19
 
CREATE TEMPORARY TABLE t1_non_trx (
20
 
  k VARCHAR(10) NOT NULL
21
 
, v VARCHAR(10) NOT NULL
22
 
, PRIMARY KEY (k)
23
 
) ENGINE=MyISAM;
24
 
 
25
 
START TRANSACTION;
26
 
 
27
 
INSERT INTO t1_trx VALUES ('key1','value1');
28
 
INSERT INTO t1_trx VALUES ('key2','value2');
29
 
 
30
 
INSERT INTO t1_non_trx VALUES ('key1','value1');
31
 
INSERT INTO t1_non_trx VALUES ('key2','value2');
32
 
 
33
 
ROLLBACK;
34
 
 
35
 
--echo Expected warning about non-trx data changes not being rolled back
36
 
 
37
 
SELECT * FROM t1_trx;
38
 
SELECT * FROM t1_non_trx;
39
 
 
40
 
START TRANSACTION;
41
 
 
42
 
INSERT INTO t1_trx VALUES ('key1','value1');
43
 
INSERT INTO t1_trx VALUES ('key2','value2');
44
 
 
45
 
SELECT t1_trx.k, t1_trx.v
46
 
FROM t1_trx
47
 
INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k;
48
 
 
49
 
ROLLBACK;
50
 
 
51
 
SELECT t1_trx.k, t1_trx.v
52
 
FROM t1_trx
53
 
INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k;
54
 
 
55
 
COMMIT;
56
 
DROP TABLE t1_trx;
57
 
DROP TABLE t1_non_trx;