-
Notifications
You must be signed in to change notification settings - Fork 6.1k
sessiontxn: reject AS OF TIMESTAMP when autocommit is disabled #65960
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
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #65960 +/- ##
================================================
- Coverage 77.7751% 77.6046% -0.1705%
================================================
Files 2001 1923 -78
Lines 545618 533201 -12417
================================================
- Hits 424355 413789 -10566
+ Misses 119601 119406 -195
+ Partials 1662 6 -1656
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
a0998ed to
f58b7fe
Compare
|
/retest |
According to the Stale Read product design, `SELECT ... AS OF TIMESTAMP` should only be used in implicit transactions with autocommit=1. However, it was possible to execute such statements even when autocommit=0. This change adds a check for `!IsAutocommit()` in `OnSelectTable` and `OnExecutePreparedStmt` methods to properly reject AS OF TIMESTAMP queries when autocommit is disabled. Close pingcap#65957
… change Update the expected result to expect error 8135 when executing AS OF TIMESTAMP query with autocommit disabled, matching the behavior change in commit f58b7fe.
54b1959 to
53a659e
Compare
|
/retest |
What problem does this PR solve?
Issue Number: close #65957
Problem Summary:
According to the Stale Read product design,
SELECT ... AS OF TIMESTAMPshould only be used in implicit transactions withautocommit=1. However, it was possible to execute such statements even whenautocommit=0.What changed and how does it work?
This change adds a check for
!IsAutocommit()inOnSelectTableandOnExecutePreparedStmtmethods inpkg/sessiontxn/staleread/processor.goto properly rejectAS OF TIMESTAMPqueries when autocommit is disabled.The error message is also updated from:
to:
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.