-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: execute batch statements in an implicit transaction #76834
Conversation
c4f5971
to
7205a02
Compare
7205a02
to
417fddf
Compare
bd01597
to
1cde010
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change by itself lgtm, but i think this may cause some tests to fail as they use multiple schema changes in the same cmd. the test failures seem suspicious as a result.
1cde010
to
1073168
Compare
1073168
to
d463dea
Compare
d463dea
to
38d4cf7
Compare
49d30bc
to
8ea59b7
Compare
8ea59b7
to
e138f8a
Compare
Canceled. |
bors r=otan |
76834: sql: execute batch statements in an implicit transaction r=otan a=rafiss fixes #44803 relates to #76490 Release justification: high value bug fix to existing functionality ### *: prepare tests for batch stmt txn change This commit will make the next one easier to review. ### sql: execute batch statements in an implicit transaction Release note (bug fix): Previously statements that arrived in a batch during the simple query protocol would all execute in their own implicit transactions. Now, we match the Postgres wire protocol, so all these statements share the same implicit transaction. If a BEGIN is included in a statement batch, then the existing implicit transaction is upgraded to an explicit transaction. ### sql: add session var for old implicit txn behavior Release note (sql change): The enable_implicit_transaction_for_batch_statements session variable was added. It defaults to true. When it is true, multiple statements in a single query (a.k.a. a "batch statement") will all be run in the same implicit transaction, which matches the Postgres wire protocol. This setting is provided for users who want to preserve the behavior of CockroachDB versions v21.2 and earlier. 77780: roachtest: update 22.1 version map to v21.2.7 r=celiala a=Azhng Release note: None Release justification: non-production code change. 77781: cloud: bump orchestrator to v21.2.7 r=celiala a=Azhng Release note: None Release justification: non-production code change. 77803: kvserverbase: move MaxCommandSizeDefault out of kvserver r=ajwerner a=ajwerner ``` $ bazel query "somepath(//pkg/sql, //pkg/kv/kvserver)" INFO: Empty results Loading: 0 packages loaded ``` Release justification: non-production code changes Release note: None Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Azhng <[email protected]> Co-authored-by: Andrew Werner <[email protected]>
53ecf6c
to
3f45266
Compare
Canceled. |
bors r=otan |
bors r- |
This commit will make the next one easier to review. Release justification: test only change Release note: None
Release justification: high value bug fix to existing functionality. Release note (bug fix): Previously statements that arrived in a batch during the simple query protocol would all execute in their own implicit transactions. Now, we match the Postgres wire protocol, so all these statements share the same implicit transaction. If a BEGIN is included in a statement batch, then the existing implicit transaction is upgraded to an explicit transaction.
Release justification: low risk new setting. Release note (sql change): The enable_implicit_transaction_for_batch_statements session variable was added. It defaults to true. When it is true, multiple statements in a single query (a.k.a. a "batch statement") will all be run in the same implicit transaction, which matches the Postgres wire protocol. This setting is provided for users who want to preserve the behavior of CockroachDB versions v21.2 and earlier.
3f45266
to
4fc43c8
Compare
bors r=otan |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating backport branch refs/heads/blathers/backport-release-21.2-76834: POST https://api.github.com/repos/cockroachlabs/cockroach/git/refs: 403 Resource not accessible by integration [] Backport to branch 21.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
fixes #44803
relates to #76490
Release justification: high value bug fix to existing functionality
*: prepare tests for batch stmt txn change
This commit will make the next one easier to review.
sql: execute batch statements in an implicit transaction
Release note (bug fix): Previously statements that arrived in a batch
during the simple query protocol would all execute in their own implicit
transactions. Now, we match the Postgres wire protocol, so all these
statements share the same implicit transaction. If a BEGIN is included
in a statement batch, then the existing implicit transaction is
upgraded to an explicit transaction.
sql: add session var for old implicit txn behavior
Release note (sql change): The enable_implicit_transaction_for_batch_statements
session variable was added. It defaults to true. When it is true,
multiple statements in a single query (a.k.a. a "batch statement") will
all be run in the same implicit transaction, which matches the Postgres
wire protocol. This setting is provided for users who want to preserve
the behavior of CockroachDB versions v21.2 and earlier.