Skip to content

Commit

Permalink
Remove the unused variable trx_t::support_xa.
Browse files Browse the repository at this point in the history
Also, merge some test changes from MySQL 5.7.10, for deprecating
innodb_support_xa.
  • Loading branch information
dr-m committed Apr 7, 2017
1 parent 84d9d28 commit 85da56b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
2 changes: 2 additions & 0 deletions mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
Expand Up @@ -85,4 +85,6 @@ xa rollback 'testb',0x2030405060,11;
SELECT * from t1;
a
30
disconnect con1;
connection default;
DROP table t1;
36 changes: 18 additions & 18 deletions mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
Expand Up @@ -26,14 +26,14 @@
--source include/have_innodb.inc
--source include/load_sysvars.inc

########################################################################
########################################################################
# START OF innodb_support_xa TESTS #
########################################################################
########################################################################


################################################################################
################################################################################
# Saving initial value of innodb_support_xa in a temporary variable #
################################################################################
################################################################################


SET @session_start_value = @@session.innodb_support_xa;
Expand All @@ -46,9 +46,9 @@ SELECT @global_start_value;


--echo '#--------------------FN_DYNVARS_046_01------------------------#'
########################################################################
########################################################################
# Display the DEFAULT value of innodb_support_xa #
########################################################################
########################################################################

SET @@session.innodb_support_xa = 0;
SET @@session.innodb_support_xa = DEFAULT;
Expand Down Expand Up @@ -83,9 +83,9 @@ SELECT @@global.innodb_support_xa;


--echo '#--------------------FN_DYNVARS_046_03------------------------#'
##########################################################################
##########################################################################
# change the value of innodb_support_xa to a valid value #
##########################################################################
##########################################################################
# for session
SET @@session.innodb_support_xa = 0;
SELECT @@session.innodb_support_xa;
Expand Down Expand Up @@ -150,9 +150,9 @@ SET @@global.innodb_support_xa =


--echo '#-------------------FN_DYNVARS_046_05----------------------------#'
###########################################################################
###########################################################################
# Test if changing global variable effects session and vice versa #
###########################################################################
###########################################################################

SET @@global.innodb_support_xa = 0;
SET @@session.innodb_support_xa = 1;
Expand All @@ -162,7 +162,7 @@ SET @@global.innodb_support_xa = 0;
SELECT @@session.innodb_support_xa AS res_is_1;

--echo '#----------------------FN_DYNVARS_046_06------------------------#'
#########################################################################
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################

Expand All @@ -179,7 +179,7 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES


--echo '#----------------------FN_DYNVARS_046_07------------------------#'
#########################################################################
#########################################################################
# Check if the value in SESSION Table matches value in variable #
#########################################################################

Expand All @@ -196,9 +196,9 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES


--echo '#---------------------FN_DYNVARS_046_08-------------------------#'
###################################################################
###################################################################
# Check if ON and OFF values can be used on variable #
###################################################################
###################################################################

SET @@session.innodb_support_xa = OFF;
SELECT @@session.innodb_support_xa;
Expand All @@ -211,9 +211,9 @@ SET @@global.innodb_support_xa = ON;
SELECT @@global.innodb_support_xa;

--echo '#---------------------FN_DYNVARS_046_09----------------------#'
###################################################################
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
###################################################################

SET @@session.innodb_support_xa = TRUE;
SELECT @@session.innodb_support_xa;
Expand All @@ -225,7 +225,7 @@ SELECT @@global.innodb_support_xa;
SET @@global.innodb_support_xa = FALSE;
SELECT @@global.innodb_support_xa;

##############################
##############################
# Restore initial value #
##############################

Expand All @@ -237,4 +237,4 @@ SELECT @@global.innodb_support_xa;

###############################################################
# END OF innodb_support_xa TESTS #
###############################################################
###############################################################
16 changes: 10 additions & 6 deletions mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
Expand Up @@ -20,9 +20,10 @@
###############################################################################

--source include/have_innodb.inc
--source include/count_sessions.inc
--echo '#--------------------FN_DYNVARS_046_01-------------------------#'
####################################################################
# Check if setting innodb_support_xa is changed in new connection #
# Check if setting innodb_support_xa is changed in new connection #
####################################################################

SET @@global.innodb_support_xa = OFF;
Expand All @@ -35,7 +36,7 @@ disconnect con1;

--echo '#--------------------FN_DYNVARS_046_01-------------------------#'
###########################################################
# Begin the functionality Testing of innodb_support_xa #
# Begin the functionality Testing of innodb_support_xa #
###########################################################

connection default;
Expand Down Expand Up @@ -101,8 +102,8 @@ xa start 'testa','testb', 123;
# gtrid [ , bqual [ , formatID ] ]
xa start 0x7465737462, 0x2030405060, 0xb;
INSERT t1 values (40);
xa end 'testb',' 0@P`',11;
xa prepare 'testb',0x2030405060,11;
xa end 'testb',' 0@P`',11;
xa prepare 'testb',0x2030405060,11;

--Error ER_XAER_RMFAIL
START TRANSACTION;
Expand All @@ -112,18 +113,21 @@ xa recover;
#disconnect con1;

CONNECTION default;
xa prepare 'testa','testb';
xa prepare 'testa','testb';
xa recover;
--Error ER_XAER_NOTA
xa commit 'testb',0x2030405060,11;
xa commit 'testa','testb';

CONNECTION con1;
xa rollback 'testb',0x2030405060,11;
xa rollback 'testb',0x2030405060,11;

SELECT * from t1;

disconnect con1;
connection default;
DROP table t1;
--source include/wait_until_count_sessions.inc

########################################################
# End of functionality Testing for innodb_support_xa #
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/include/trx0trx.h
Expand Up @@ -1043,7 +1043,6 @@ struct trx_t {
for secondary indexes when we decide
if we can use the insert buffer for
them, we set this FALSE */
bool support_xa; /*!< normally we do the XA two-phase */
bool flush_log_later;/* In 2PC, we hold the
prepare_commit mutex across
both phases. In that case, we
Expand Down
2 changes: 0 additions & 2 deletions storage/innobase/trx/trx0trx.cc
Expand Up @@ -145,8 +145,6 @@ trx_init(

trx->check_unique_secondary = true;

trx->support_xa = true;

trx->lock.n_rec_locks = 0;

trx->dict_operation = TRX_DICT_OP_NONE;
Expand Down

0 comments on commit 85da56b

Please sign in to comment.