~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/innodb_support_xa_func.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################# mysql-test\t\innodb_support_xa_func.test  ###################
 
2
#                                                                             #
 
3
# Variable Name: innodb_support_xa                                            #
 
4
# Scope: GLOBAL | SESSION                                                     #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: boolean                                                          #
 
7
# Default Value: 1                                                            #
 
8
# Range: 0,1                                                                  #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-03-08                                                   #
 
12
# Author:  Rizwan                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable innodb_support_xa        #
 
15
#              that checks the behavior of this variable in the following ways#
 
16
#                                                                             #
 
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
 
18
#  server-system-variables.html                                               #
 
19
#                                                                             #
 
20
###############################################################################
 
21
 
 
22
--source include/have_innodb.inc
 
23
--echo '#--------------------FN_DYNVARS_046_01-------------------------#'
 
24
####################################################################
 
25
# Check if setting innodb_support_xa is changed in new connection  # 
 
26
####################################################################
 
27
 
 
28
SET @@global.innodb_support_xa = OFF;
 
29
--echo 'connect (con1,localhost,root,,,,)'
 
30
connect (con1,localhost,root,,,,);
 
31
--echo 'connection con1'
 
32
connection con1;
 
33
SELECT @@global.innodb_support_xa;
 
34
SELECT @@session.innodb_support_xa;
 
35
disconnect con1;
 
36
 
 
37
 
 
38
--echo '#--------------------FN_DYNVARS_046_01-------------------------#'
 
39
###########################################################
 
40
# Begin the functionality Testing of innodb_support_xa    # 
 
41
###########################################################
 
42
 
 
43
--echo 'connection default'
 
44
connection default;
 
45
SET @@global.innodb_support_xa = 1;
 
46
 
 
47
--disable_warnings
 
48
drop table if exists t1, t2;
 
49
--enable_warnings
 
50
 
 
51
create table t1 (a int) engine=innodb;
 
52
 
 
53
#====================================================
 
54
--echo '---check when innodb_support_xa is 1---'
 
55
#====================================================
 
56
 
 
57
 
 
58
SET @@innodb_support_xa = 1;
 
59
 
 
60
xa start 'test1';
 
61
INSERT t1 values (10);
 
62
xa end 'test1';
 
63
xa prepare 'test1';
 
64
xa rollback 'test1';
 
65
SELECT * from t1;
 
66
 
 
67
#====================================================
 
68
--echo '---check when innodb_support_xa is 0---'
 
69
#====================================================
 
70
 
 
71
SET @@innodb_support_xa = 0;
 
72
#
 
73
xa start 'test1';
 
74
INSERT t1 values (10);
 
75
xa end 'test1';
 
76
xa prepare 'test1';
 
77
xa rollback 'test1';
 
78
SELECT * from t1;
 
79
 
 
80
#====================================================
 
81
--echo '------general xa testing--------'
 
82
#====================================================
 
83
 
 
84
SET @@global.innodb_support_xa = 1;
 
85
SET @@innodb_support_xa = 1;
 
86
 
 
87
xa start 'testa','testb';
 
88
INSERT t1 values (30);
 
89
--Error ER_XAER_RMFAIL
 
90
COMMIT;
 
91
xa end 'testa','testb';
 
92
--Error ER_XAER_RMFAIL
 
93
BEGIN;
 
94
--Error ER_XAER_RMFAIL
 
95
CREATE table t2 (a int);
 
96
--echo 'connect (con1,localhost,root,,,,)'
 
97
CONNECT (con1,localhost,root,,,,);
 
98
--echo 'connection con1'
 
99
connection con1;
 
100
 
 
101
--Error ER_XAER_DUPID
 
102
xa start 'testa','testb';
 
103
--Error ER_XAER_DUPID
 
104
xa start 'testa','testb', 123;
 
105
 
 
106
#        gtrid [ , bqual [ , formatID ] ]
 
107
xa start 0x7465737462, 0x2030405060, 0xb;
 
108
INSERT t1 values (40);
 
109
xa end 'testb',' 0@P`',11; 
 
110
xa prepare 'testb',0x2030405060,11; 
 
111
 
 
112
--Error ER_XAER_RMFAIL
 
113
START TRANSACTION;
 
114
xa recover;
 
115
 
 
116
# uncomment the line below when binlog will be able to prepare
 
117
#disconnect con1;
 
118
 
 
119
--echo 'connection default'
 
120
CONNECTION default;
 
121
xa prepare 'testa','testb'; 
 
122
xa recover;
 
123
--Error ER_XAER_NOTA
 
124
xa commit 'testb',0x2030405060,11;
 
125
xa commit 'testa','testb';
 
126
 
 
127
--echo 'connection con1'
 
128
CONNECTION con1;
 
129
xa rollback 'testb',0x2030405060,11; 
 
130
 
 
131
SELECT * from t1;
 
132
 
 
133
DROP table t1;
 
134
 
 
135
########################################################
 
136
# End of functionality Testing for innodb_support_xa   #
 
137
########################################################
 
138