-
Notifications
You must be signed in to change notification settings - Fork 5.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
optimizer_switch is read only #29040
Comments
For context: this came up while we were looking at tests. It is a noop sysvar in TiDB, but different from other noops it's read-only. This might be the correct behavior (given it is a noop), but I suggested we should create a bug report so we can discuss and have something to point to for future discussion. If we know apps that are setting @dveeden @mjonss @ThomasYYYY what do you think? |
In MySQL the We could:
I think always returning an error is the most correct, but accepting either all or known values would increase compatibility. The docs say that
|
I actually prefer |
So I assume it is statically set and not even changeable through a configuration file?
And I also assume that these optimizer_switch values is as good description of the current TiDB optimizer. If my assumptions are valid, then I agree on keeping it as read_only, since we will not change the optimizer behaviour due to the optimizer_switch anyway. Technically it would be better to return an error and prohibit any other value that what is already set, but I see no real benefit of such change. |
That's right. It's static, most likely based on the defaults from MySQL 5.6. |
I think "accept known values from MySQL" offers the best compatibility. |
OK, I will leave it open for now as is. If a user comes across this issue and has a case where we need to support modifying optimizer_switch, we can reconsider. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: