Add transaction for the operation of insert #6244#6245
Merged
morningman merged 8 commits intoapache:masterfrom Jul 21, 2021
pengxiangyu:master
Merged
Add transaction for the operation of insert #6244#6245morningman merged 8 commits intoapache:masterfrom pengxiangyu:master
morningman merged 8 commits intoapache:masterfrom
pengxiangyu:master
Conversation
Contributor
|
Please add the motivation and benefits of this feature in your issue. |
morningman
reviewed
Jul 19, 2021
Contributor
morningman
left a comment
There was a problem hiding this comment.
Please also add document for this feature, for both syntax doc and usage doc.
You can refer to #6230
Closed
w41ter
pushed a commit
to w41ter/incubator-doris
that referenced
this pull request
Dec 26, 2025
## Proposed changes Issue Number: close #xxx <!--Describe your changes.--> Co-authored-by: Yongqiang YANG <yangyogqiang@selectdb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Add transaction for the operation of insert. It will cost less time than non-transaction(it will cost 1/1000 time) when you want to insert a amount of rows.
Syntax
Example
commit a transaction:
rollback a transaction:
commit a transaction with label:
Description
The main realization principle:
Some restrictions on the use of update syntax.
insertcan be called in a transaction.commitwill not succeed, it willrollbackdirectly;commitwill only insert the other correct data into the table.commitreturn failed when any insert in the transaction is invalid, you need executeset enable_insert_strict = truebeforebegin.Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments