Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Error Handling and Cleanup during Insert Bulk Process (babelfish-…
…for-postgresql#2887) This commit fixes an issue with the error handling and cleanup phase of the Insert Bulk Process. 1. For Error Handling there was a scenario where bulk_load_callback(0, 0, NULL, NULL) call for cleanup would flush the remaining rows during EndBulkCopy and could result in an error. To fix this, we move the transaction rollback logic from TSQL extension to TDS. We also improved it by using Savepoints in case of active transaction which is aligned with TSQL behaviour. 2. In this case, if we have a reset-connection after the Bulk Load TDS packet we werent cleaning up the Bulk Load state. To do so we reset the offset. 3. During Reset Connection TDS is not resetting any TSQL transaction semantic. To resolve this we introduce a wrapper of AbortOutOfAnyTransaction to reset NestedTranCount. Issues Resolved BABEL-5200, BABEL-5199, BABEL-5220 Authored-by: Kushaal Shroff [email protected] Signed-off-by: Kushaal Shroff [email protected]
- Loading branch information