-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[5.2] Modified MySqlConnector to allow a config param to execute the use #13589
Conversation
Is there any reason we don't just always call the use statement? Would it really cause problems to just always make the call? |
It's probably better not to make such SQL statements when they are not required. There is the overhead of course, and it could only introduce problems, potentially. |
By the way, what is the use case for this PR? |
I think we should just always make the call. It takes 0.04ms to complete on my machine. |
:-(
|
If you have the same table on multiple databases it defines the default database, which should always be the database you actually have configured.
|
The way that we have our replication setup, it requires us to issue a use statement for any changes made to the database, by putting the config in the if check, will allow us to choose to make this call all the time. Since this is a config parameter, it shouldn't affect anything for existing users or users that don't need that call. Is this enough for you guys to reopen the PR? This would be awesome to have in the code base so that we don't have to make changes with each upgrade. |
@mclubb I think you should have had either:
|
Added a config param to call the exec Use Statement in the mysql connector