~drizzle-trunk/drizzle/development

1273.1.27 by Jay Pipes
Completes the work of removing the weirdness around transaction
1
DROP TABLE IF EXISTS t1_trx, t1_non_trx;
2
SET AUTOCOMMIT= 0;
3
CREATE TABLE t1_trx (
4
k VARCHAR(10) NOT NULL
5
, v VARCHAR(10) NOT NULL
6
, PRIMARY KEY (k)
7
) ENGINE=InnoDB;
8
CREATE TEMPORARY TABLE t1_non_trx (
9
k VARCHAR(10) NOT NULL
10
, v VARCHAR(10) NOT NULL
11
, PRIMARY KEY (k)
12
) ENGINE=MyISAM;
13
START TRANSACTION;
14
INSERT INTO t1_trx VALUES ('key1','value1');
15
INSERT INTO t1_trx VALUES ('key2','value2');
16
INSERT INTO t1_non_trx VALUES ('key1','value1');
17
INSERT INTO t1_non_trx VALUES ('key2','value2');
18
ROLLBACK;
19
Warnings:
20
Warning	1196	Some non-transactional changed tables couldn't be rolled back
21
Expected warning about non-trx data changes not being rolled back
22
SELECT * FROM t1_trx;
23
k	v
24
SELECT * FROM t1_non_trx;
25
k	v
26
key1	value1
27
key2	value2
28
START TRANSACTION;
2131.9.1 by Stewart Smith
on START TRANSACTION being called during a transaction, output a warning that a transaction is already in progress. This is the same behaviour as PostgreSQL. We used to do an implicit commit. This is totally not the right thing to do.
29
Warnings:
2143.1.4 by Brian Aker
Update for test conflict (warning number off).
30
Warning	1746	There is already a transaction in progress
1273.1.27 by Jay Pipes
Completes the work of removing the weirdness around transaction
31
INSERT INTO t1_trx VALUES ('key1','value1');
32
INSERT INTO t1_trx VALUES ('key2','value2');
33
SELECT t1_trx.k, t1_trx.v
34
FROM t1_trx
35
INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k;
36
k	v
37
key1	value1
38
key2	value2
39
ROLLBACK;
40
SELECT t1_trx.k, t1_trx.v
41
FROM t1_trx
42
INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k;
43
k	v
1890.2.19 by Stewart Smith
use explicit COMMIT in transaction test instead of implicit commit in DROP TABLE
44
COMMIT;
1273.1.27 by Jay Pipes
Completes the work of removing the weirdness around transaction
45
DROP TABLE t1_trx;
46
DROP TABLE t1_non_trx;