~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/statement_boundaries.test

Fix merge issues with 1.0 CC fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This is a test of various SQL statements
 
2
# and looks at the statement and transaction
 
3
# boundaries (start/end) to ensure they are sane
 
4
 
 
5
SET AUTOCOMMIT= 0;
 
6
 
 
7
# Expect 0 commit count since nothing 
 
8
# has yet happened...
 
9
 
 
10
SHOW STATUS LIKE 'Handler_commit%';
 
11
 
 
12
BEGIN;
 
13
 
 
14
# Expect 0 commit count since nothing 
 
15
# has yet been committed...
 
16
 
 
17
SHOW STATUS LIKE 'Handler_commit%';
 
18
 
 
19
COMMIT;
 
20
DROP SCHEMA IF EXISTS boundaries;
 
21
 
 
22
# Expect 1 commit count since above COMMIT before DROP SCHEMA
 
23
#
 
24
# When we get transactional DDL, should be 0.
 
25
SHOW STATUS LIKE 'Handler_commit%';
 
26
 
 
27
COMMIT;
 
28
 
 
29
# Expect 1 commit count since 
 
30
# an explicit call to COMMIT was made
 
31
# even though nothing was changed...
 
32
 
 
33
SHOW STATUS LIKE 'Handler_commit%';
 
34
 
 
35
 
 
36
## Enable AUOTOCOMMIT
 
37
#
 
38
SET AUTOCOMMIT= 1;
 
39
 
 
40
SHOW STATUS LIKE 'Handler_commit%';
 
41
DROP SCHEMA IF EXISTS boundaries;
 
42
BEGIN;
 
43
COMMIT;
 
44
 
 
45
SHOW STATUS LIKE 'Handler_commit%';
 
46
CREATE TABLE commit_test (a int);
 
47
SHOW STATUS LIKE 'Handler_commit%';
 
48
INSERT into commit_test VALUES (10);
 
49
SHOW STATUS LIKE 'Handler_commit%';
 
50
INSERT into commit_test VALUES (10), (20);
 
51
SHOW STATUS LIKE 'Handler_commit%';
 
52
INSERT into commit_test VALUES (10);
 
53
SHOW STATUS LIKE 'Handler_commit%';
 
54
 
 
55
BEGIN;
 
56
 
 
57
INSERT into commit_test VALUES (10);
 
58
SHOW STATUS LIKE 'Handler_commit%';
 
59
 
 
60
COMMIT;
 
61
 
 
62
SHOW STATUS LIKE 'Handler_commit%';
 
63
BEGIN;
 
64
 
 
65
INSERT into commit_test VALUES (10);
 
66
SHOW STATUS LIKE 'Handler_commit%';
 
67
 
 
68
ROLLBACK;
 
69
 
 
70
SHOW STATUS LIKE 'Handler_commit%';
 
71
BEGIN;
 
72
 
 
73
 
 
74
INSERT into commit_test VALUES (10);
 
75
SHOW STATUS LIKE 'Handler_commit%';
 
76
 
 
77
COMMIT;
 
78
SHOW STATUS LIKE 'Handler_commit%';
 
79
 
 
80
SET AUTOCOMMIT= 0;
 
81
INSERT into commit_test VALUES (10);
 
82
INSERT into commit_test VALUES (10);
 
83
 
 
84
 
 
85
SHOW STATUS LIKE 'Handler_commit%';
 
86
COMMIT;
 
87
drop table commit_test;
 
88
SHOW STATUS LIKE 'Handler_commit%';