Don't try to EXPLAIN select_db calls #10553

Merged
merged 1 commit into from May 10, 2013

Conversation

Projects
None yet
2 participants
Contributor

dasch commented May 10, 2013

I'm using the mysql2 adapter and my app switches back and forth between a few databases in order to do sharding. I've been getting these errors: ActiveRecord::StatementInvalid: Mysql2::Error: Table '<dbname>.select_db' doesn't exist: EXPLAIN select_db <dbname>.

This pull requests fixes the problem caused by an overly fuzzy matching of the SQL commands that can be explained.

fxn added a commit that referenced this pull request May 10, 2013

@fxn fxn merged commit 7d74a31 into rails:master May 10, 2013

Contributor

dasch commented May 10, 2013

That was fast, thanks!

@dasch dasch deleted the dasch:dasch/dont-try-to-explain-select_db branch May 10, 2013

Contributor

dasch commented May 10, 2013

@fxn would it be possible to backport it to 4-0-stable and perhaps 3-2-stable?

Owner

fxn commented May 10, 2013

Makes sense, would you like to contribute the patches?

Contributor

dasch commented May 10, 2013

Sure!

Contributor

dasch commented May 10, 2013

@fxn I've created two PRs, one for 4-0-stable and one for 3-2-stable.

Owner

fxn commented May 10, 2013

Awesome, those patches were even faster :). Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment