-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: move checks for noop functions in select statements to preprocess #53279
planner: move checks for noop functions in select statements to preprocess #53279
Conversation
Hi @henrybw. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #53279 +/- ##
================================================
+ Coverage 72.4943% 73.9689% +1.4746%
================================================
Files 1493 1499 +6
Lines 429359 437655 +8296
================================================
+ Hits 311261 323729 +12468
+ Misses 98889 93749 -5140
- Partials 19209 20177 +968
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/cc @hawkingrei |
/retest |
@henrybw: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, hawkingrei, tangenta The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
What problem does this PR solve?
Issue Number: close #52432
Problem Summary:
The
LOCK IN SHARE MODE
clause forSELECT
statements is currently a noop, controlled bytidb_enable_noop_functions
: whentidb_enable_noop_functions=OFF
, using a noop likeLOCK IN SHARE MODE
should cause an error. However, point-get queries use a special "fast path" that accidentally bypasses this noop check, meaning that a query likeselect * from t where a=1 lock in share mode;
(wherea
is a key column) will run even whentidb_enable_noop_functions=OFF
.What changed and how does it work?
SELECT
statements (bothLOCK IN SHARE MODE
andSQL_CALC_FOUND_ROWS
) out ofbuildLogicalPlan
and intoPreprocess
, which runs before theTryFastPlan
fast path for point-get queries.noop_functions
test case tointegrationtest
, testing the noop function checks for bothLOCK IN SHARE MODE
andSQL_CALC_FOUND_ROWS
based on the existingTestNoopFunctions
"unit test" inpkg/expression/integration_test/integration_test.go
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.