Commit 226c249a authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

refs codership/mysql-wsrep#53 - fencing LOAD DATA splitting related commit to...

refs codership/mysql-wsrep#53 - fencing LOAD DATA splitting related commit to not happen with ALTER processing
parent f725b0c4
...@@ -6554,6 +6554,10 @@ wsrep_store_key_val_for_row( ...@@ -6554,6 +6554,10 @@ wsrep_store_key_val_for_row(
DBUG_RETURN((uint)(buff - buff_start)); DBUG_RETURN((uint)(buff - buff_start));
} }
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
/*******************************************************************//**
Stores a key value for a row to a buffer.
@return key value length as stored in buff */
UNIV_INTERN UNIV_INTERN
uint uint
ha_innobase::store_key_val_for_row( ha_innobase::store_key_val_for_row(
...@@ -7480,15 +7484,19 @@ ha_innobase::write_row( ...@@ -7480,15 +7484,19 @@ ha_innobase::write_row(
; ;
} else if (src_table == prebuilt->table) { } else if (src_table == prebuilt->table) {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd) && wsrep_load_data_splitting &&
sql_command == SQLCOM_LOAD &&
!thd_test_options(
user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
case WSREP_TRX_SIZE_EXCEEDED: case WSREP_TRX_SIZE_EXCEEDED:
case WSREP_TRX_CERT_FAIL: case WSREP_TRX_CERT_FAIL:
case WSREP_TRX_ERROR: case WSREP_TRX_ERROR:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (binlog_hton->commit(binlog_hton, user_thd, 1)) if (binlog_hton->commit(binlog_hton, user_thd, 1))
...@@ -7507,15 +7515,19 @@ ha_innobase::write_row( ...@@ -7507,15 +7515,19 @@ ha_innobase::write_row(
prebuilt->sql_stat_start = TRUE; prebuilt->sql_stat_start = TRUE;
} else { } else {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd) && wsrep_load_data_splitting &&
sql_command == SQLCOM_LOAD &&
!thd_test_options(
user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
case WSREP_TRX_SIZE_EXCEEDED: case WSREP_TRX_SIZE_EXCEEDED:
case WSREP_TRX_CERT_FAIL: case WSREP_TRX_CERT_FAIL:
case WSREP_TRX_ERROR: case WSREP_TRX_ERROR:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (binlog_hton->commit(binlog_hton, user_thd, 1)) if (binlog_hton->commit(binlog_hton, user_thd, 1))
......
...@@ -6808,10 +6808,10 @@ innobase_read_from_2_little_endian( ...@@ -6808,10 +6808,10 @@ innobase_read_from_2_little_endian(
return((uint) ((ulint)(buf[0]) + 256 * ((ulint)(buf[1])))); return((uint) ((ulint)(buf[0]) + 256 * ((ulint)(buf[1]))));
} }
#ifdef WITH_WSREP
/*******************************************************************//** /*******************************************************************//**
Stores a key value for a row to a buffer. Stores a key value for a row to a buffer.
@return key value length as stored in buff */ @return key value length as stored in buff */
#ifdef WITH_WSREP
UNIV_INTERN UNIV_INTERN
uint uint
wsrep_store_key_val_for_row( wsrep_store_key_val_for_row(
...@@ -7959,11 +7959,11 @@ ha_innobase::write_row( ...@@ -7959,11 +7959,11 @@ ha_innobase::write_row(
dberr_t error; dberr_t error;
int error_result= 0; int error_result= 0;
ibool auto_inc_used= FALSE; ibool auto_inc_used= FALSE;
ulint sql_command;
trx_t* trx = thd_to_trx(user_thd);
#ifdef WITH_WSREP #ifdef WITH_WSREP
ibool auto_inc_inserted= FALSE; /* if NULL was inserted */ ibool auto_inc_inserted= FALSE; /* if NULL was inserted */
#endif #endif
ulint sql_command;
trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::write_row"); DBUG_ENTER("ha_innobase::write_row");
...@@ -8001,7 +8001,9 @@ ha_innobase::write_row( ...@@ -8001,7 +8001,9 @@ ha_innobase::write_row(
|| sql_command == SQLCOM_CREATE_INDEX || sql_command == SQLCOM_CREATE_INDEX
#ifdef WITH_WSREP #ifdef WITH_WSREP
|| (wsrep_on(user_thd) && wsrep_load_data_splitting && || (wsrep_on(user_thd) && wsrep_load_data_splitting &&
sql_command == SQLCOM_LOAD) sql_command == SQLCOM_LOAD &&
!thd_test_options(
user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
|| sql_command == SQLCOM_DROP_INDEX) || sql_command == SQLCOM_DROP_INDEX)
&& num_write_row >= 10000) { && num_write_row >= 10000) {
...@@ -8045,15 +8047,19 @@ ha_innobase::write_row( ...@@ -8045,15 +8047,19 @@ ha_innobase::write_row(
; ;
} else if (src_table == prebuilt->table) { } else if (src_table == prebuilt->table) {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd) && wsrep_load_data_splitting &&
sql_command == SQLCOM_LOAD &&
!thd_test_options(
user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
case WSREP_TRX_SIZE_EXCEEDED: case WSREP_TRX_SIZE_EXCEEDED:
case WSREP_TRX_CERT_FAIL: case WSREP_TRX_CERT_FAIL:
case WSREP_TRX_ERROR: case WSREP_TRX_ERROR:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (binlog_hton->commit(binlog_hton, user_thd, 1)) if (binlog_hton->commit(binlog_hton, user_thd, 1))
...@@ -8072,15 +8078,19 @@ ha_innobase::write_row( ...@@ -8072,15 +8078,19 @@ ha_innobase::write_row(
prebuilt->sql_stat_start = TRUE; prebuilt->sql_stat_start = TRUE;
} else { } else {
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (wsrep_on(user_thd)) { if (wsrep_on(user_thd) && wsrep_load_data_splitting &&
sql_command == SQLCOM_LOAD &&
!thd_test_options(
user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
{
switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1))
{ {
case WSREP_TRX_OK: case WSREP_TRX_OK:
break; break;
case WSREP_TRX_SIZE_EXCEEDED: case WSREP_TRX_SIZE_EXCEEDED:
case WSREP_TRX_CERT_FAIL: case WSREP_TRX_CERT_FAIL:
case WSREP_TRX_ERROR: case WSREP_TRX_ERROR:
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (binlog_hton->commit(binlog_hton, user_thd, 1)) if (binlog_hton->commit(binlog_hton, user_thd, 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment