提交 f8b7cd67 authored 作者: Mike Poindexter's avatar Mike Poindexter

Fix dropped rows when executing UPDATE and SELECT FOR UPDATE

Fixes Github issue #180
上级 e128f2a5
......@@ -463,7 +463,16 @@ public abstract class Table extends SchemaObjectBase {
}
Row o = rows.next();
rows.next();
removeRow(session, o);
try {
removeRow(session, o);
} catch (DbException e) {
if (e.getErrorCode() == ErrorCode.CONCURRENT_UPDATE_1) {
session.rollbackTo(rollback, false);
session.startStatementWithinTransaction();
rollback = session.setSavepoint();
}
throw e;
}
session.log(this, UndoLogRecord.DELETE, o);
}
// add the new rows
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论