Skip to content
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

Closed
wants to merge 3 commits into from
Closed

[5.2] Modified MySqlConnector to allow a config param to execute the use #13589

wants to merge 3 commits into from

Conversation

mclubb
Copy link

@mclubb mclubb commented May 17, 2016

Added a config param to call the exec Use Statement in the mysql connector

@GrahamCampbell GrahamCampbell changed the title Modified MySqlConnector to allow a config param to execute the use [5.2] Modified MySqlConnector to allow a config param to execute the use May 17, 2016
@taylorotwell
Copy link
Member

Is there any reason we don't just always call the use statement? Would it really cause problems to just always make the call?

@vlakoff
Copy link
Contributor

vlakoff commented May 23, 2016

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.

@vlakoff
Copy link
Contributor

vlakoff commented May 23, 2016

By the way, what is the use case for this PR?

@taylorotwell
Copy link
Member

I think we should just always make the call. It takes 0.04ms to complete on my machine.

@vlakoff
Copy link
Contributor

vlakoff commented May 23, 2016

:-(

  • for a single call, 0.04ms is huge
  • why making unneeded calls? what good could it bring?
  • I'd be interested to know @mclubb's use case.

@taylorotwell
Copy link
Member

If you have the same table on multiple databases it defines the default database, which should always be the database you actually have configured.

On May 23, 2016, at 10:44 AM, vlakoff notifications@github.com wrote:

:-(

for a single call, 0.04ms is huge
why making unneeded calls? what good could it bring?
I'd be interested to know @mclubb https://github.com/mclubb's use case.

You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub #13589 (comment)

@mclubb
Copy link
Author

mclubb commented May 23, 2016

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.

@vlakoff
Copy link
Contributor

vlakoff commented May 23, 2016

See ef770ed.

edit: then see #13701. I told you. 😇

@vlakoff
Copy link
Contributor

vlakoff commented May 25, 2016

@mclubb I think you should have had either:

  • added this statement in your application
  • or written a custom connector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants