-
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: disable SQL_CALC_FOUND_ROWS/LOCK IN SHARE MODE by default #19506
Conversation
I noticed after I wrote this, that I could also implement this in |
I have updated this PR to fix |
/run-all-tests |
/run-unit-test |
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.
LGTM
/run-all-tests tidb-test=pr/1087 |
/run-all-tests tidb-test=pr/1087 |
/run-integration-ddl-test tidb-test=pr/1087 |
1 similar comment
/run-integration-ddl-test tidb-test=pr/1087 |
/run-unit-test tidb-test=pr/1087 |
1 similar comment
/run-unit-test tidb-test=pr/1087 |
/run-integration-ddl-test tidb-test=pr/1087 |
/run-unit-test |
Thanks! Should be fixed now. |
/merge |
/run-all-tests |
@nullnotnil merge failed. |
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #21005 |
What problem does this PR solve?
Issue Number: Fixes #14448 but leaves #8235 open to (eventually) add the functionality
Also fixes #19383
Problem Summary:
Unless you are reading every page of the TiDB manual, you may not notice that a query using
SQL_CALC_FOUND_ROWS
will return wrong results without a warning or error. This is unsafe, as described why in #14448.Similarly,
SELECT LOCK IN SHARE MODE
is also described in the manual as a noop. But that's not obvious to new users.This protects against incorrect usage via the enable_noop_functions flag; meaning that applications that want to execute the query and receive broken results have a way out.
What is changed and how it works?
What's Changed:
Queries using SQL_CALC_FOUND_ROWS or LOCK IN SHARE MODE now get an error by default.
Related changes
Docs PR pingcap/docs#3898
Check List
Tests
Side effects
Release note
SQL_CALC_FOUND_ROWS
orLOCK IN SHARE MODE
. This helps alert users that this feature is not implemented by TiDB, but a workaround to restore the previous behavior is available by settingtidb_enable_noop_functions=1
.