1#
2# WL#5968: Implement START TRANSACTION READ (WRITE|ONLY);
3#
4#
5# Test9:  The --transaction-read-only startup option.
6# Check that the option was set by the .opt file.
7SELECT @@tx_read_only;
8@@tx_read_only
91
10# Also for new connections. Switching to con1
11SELECT @@tx_read_only;
12@@tx_read_only
131
14SET SESSION TRANSACTION READ WRITE;
15SELECT @@tx_read_only;
16@@tx_read_only
170
18# Connection default
19SELECT @@tx_read_only;
20@@tx_read_only
211
22#
23# Test 10: SET TRANSACTION / START TRANSACTION + implicit commit.
24SET SESSION TRANSACTION READ WRITE;
25SET TRANSACTION READ ONLY;
26# Since DDL does implicit commit before starting, SET TRANSACTION
27# will have no effect because the "next" transaction will already
28# be over before the DDL statement starts.
29CREATE TABLE t1 (a INT);
30START TRANSACTION READ ONLY;
31# The same happens with START TRANSACTION
32DROP TABLE t1;
33#
34# Test 11: INSERT DELAYED
35CREATE TABLE t1(a INT);
36START TRANSACTION READ ONLY;
37INSERT DELAYED INTO t1 VALUES (1);
38ERROR 25006: Cannot execute statement in a READ ONLY transaction.
39COMMIT;
40DROP TABLE t1;
41