1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #1316 from dhall-MariaDB/MCOL-4124

MCOL-4124 return error when COMMIT|ROLLBACK error
This commit is contained in:
Patrick LeBlanc
2020-06-30 11:00:08 -05:00
committed by GitHub

View File

@ -545,28 +545,26 @@ int ha_mcs_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abo
return rc; return rc;
//@Bug 4605 //@Bug 4605
int rc1 = 0;
if ( (rc == 0) && !abort && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) if ( (rc == 0) && !abort && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))))
{ {
ci.rowsHaveInserted += size; ci.rowsHaveInserted += size;
command = "COMMIT"; command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema ); rc1 = ProcessCommandStatement ( thd, command, ci, schema );
} }
else if (useHdfs) else if (useHdfs)
{ {
ci.rowsHaveInserted += size; ci.rowsHaveInserted += size;
command = "COMMIT"; command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema ); rc1 = ProcessCommandStatement ( thd, command, ci, schema );
} }
else if (( rc != 0) || abort ) else if (( rc != 0) || abort )
{ {
command = "ROLLBACK"; command = "ROLLBACK";
ProcessCommandStatement ( thd, command, ci, schema ); rc1 = ProcessCommandStatement ( thd, command, ci, schema );
} }
else rc = max(rc, rc1);
{
return rc;
}
return rc; return rc;
} }
@ -630,26 +628,28 @@ int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info&
if ( thd->killed > 0 ) if ( thd->killed > 0 )
{ {
command = "ROLLBACK"; command = "ROLLBACK";
ProcessCommandStatement ( thd, command, ci, schema ); rc = ProcessCommandStatement ( thd, command, ci, schema );
} }
else if (rc != dmlpackageprocessor::DMLPackageProcessor::ACTIVE_TRANSACTION_ERROR) else if (rc != dmlpackageprocessor::DMLPackageProcessor::ACTIVE_TRANSACTION_ERROR)
{ {
//@Bug 4605 //@Bug 4605
int rc1 = 0;
if ( rc != 0 ) if ( rc != 0 )
{ {
command = "ROLLBACK"; command = "ROLLBACK";
ProcessCommandStatement ( thd, command, ci, schema ); rc1 = ProcessCommandStatement ( thd, command, ci, schema );
} }
else if (( rc == 0 ) && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) else if (( rc == 0 ) && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))))
{ {
command = "COMMIT"; command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema ); rc1 = ProcessCommandStatement ( thd, command, ci, schema );
} }
else if (useHdfs) else if (useHdfs)
{ {
command = "COMMIT"; command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema ); rc1 = ProcessCommandStatement ( thd, command, ci, schema );
} }
rc = max(rc, rc1);
} }
} }
@ -1702,7 +1702,7 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca
} }
else else
{ {
buf = buf + 2 ; buf = buf + 2;
} }
} }
else //utf8 else //utf8