Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fe/src/main/java/org/apache/doris/qe/StmtExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,12 @@ private void handleInsertStmt() throws Exception {
return;
}

if (insertStmt.getQueryStmt() != null && (coord.getCommitInfos() == null || coord.getCommitInfos().isEmpty())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we have already begin a transaction for this insert statement, if you return here now, it will become a pending transaction.
I think that you should abort this transaction before return to user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌,I will check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we have already begin a transaction for this insert statement, if you return here now, it will become a pending transaction.
I think that you should abort this transaction before return to user

add abort operation;
sry ,I habitually performed a git rebase operation

Catalog.getCurrentGlobalTransactionMgr().abortTransaction(insertStmt.getTransactionId(), "select stmt return empty set when insert");
context.getState().setOk();
return;
}

Catalog.getCurrentGlobalTransactionMgr().commitAndPublishTransaction(
insertStmt.getDbObj(), insertStmt.getTransactionId(),
TabletCommitInfo.fromThrift(coord.getCommitInfos()),
Expand Down