1
################# mysql-test\t\innodb_support_xa_func.test ###################
3
# Variable Name: innodb_support_xa #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
11
# Creation Date: 2008-03-08 #
14
# Description: Test Cases of Dynamic System Variable innodb_support_xa #
15
# that checks the behavior of this variable in the following ways#
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
18
# server-system-variables.html #
20
###############################################################################
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
####################################################################
28
SET @@global.innodb_support_xa = OFF;
29
--echo 'connect (con1,localhost,root,,,,)'
30
connect (con1,localhost,root,,,,);
31
--echo 'connection con1'
33
SELECT @@global.innodb_support_xa;
34
SELECT @@session.innodb_support_xa;
38
--echo '#--------------------FN_DYNVARS_046_01-------------------------#'
39
###########################################################
40
# Begin the functionality Testing of innodb_support_xa #
41
###########################################################
43
--echo 'connection default'
45
SET @@global.innodb_support_xa = 1;
48
drop table if exists t1, t2;
51
create table t1 (a int) engine=innodb;
53
#====================================================
54
--echo '---check when innodb_support_xa is 1---'
55
#====================================================
58
SET @@innodb_support_xa = 1;
61
INSERT t1 values (10);
67
#====================================================
68
--echo '---check when innodb_support_xa is 0---'
69
#====================================================
71
SET @@innodb_support_xa = 0;
74
INSERT t1 values (10);
80
#====================================================
81
--echo '------general xa testing--------'
82
#====================================================
84
SET @@global.innodb_support_xa = 1;
85
SET @@innodb_support_xa = 1;
87
xa start 'testa','testb';
88
INSERT t1 values (30);
89
--Error ER_XAER_RMFAIL
91
xa end 'testa','testb';
92
--Error ER_XAER_RMFAIL
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'
101
--Error ER_XAER_DUPID
102
xa start 'testa','testb';
103
--Error ER_XAER_DUPID
104
xa start 'testa','testb', 123;
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;
112
--Error ER_XAER_RMFAIL
116
# uncomment the line below when binlog will be able to prepare
119
--echo 'connection default'
121
xa prepare 'testa','testb';
124
xa commit 'testb',0x2030405060,11;
125
xa commit 'testa','testb';
127
--echo 'connection con1'
129
xa rollback 'testb',0x2030405060,11;
135
########################################################
136
# End of functionality Testing for innodb_support_xa #
137
########################################################