state.end_statement() should not be called separately in cases where abort() already does it

This commit is contained in:
Jussi Saurio
2025-11-18 13:02:19 +02:00
parent 7a12e184a8
commit be6f8ab8b3

View File

@@ -2071,8 +2071,6 @@ pub fn halt(
description: &str,
) -> Result<InsnFunctionStepResult> {
if err_code > 0 {
// Any non-FK constraint violation causes the statement subtransaction to roll back.
state.end_statement(&program.connection, pager, EndStatement::RollbackSavepoint)?;
vtab_rollback_all(&program.connection, state)?;
}
match err_code {
@@ -2110,7 +2108,6 @@ pub fn halt(
.load(Ordering::Acquire)
> 0
{
state.end_statement(&program.connection, pager, EndStatement::RollbackSavepoint)?;
return Err(LimboError::Constraint(
"foreign key constraint failed".to_string(),
));