Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Prevent multiple SHOW TABLES calls when a table don't exists in database... #3609

Merged
merged 1 commit into from

3 participants

@tenderlove tenderlove merged commit 1c6d6b6 into from
@noefroidevaux

I did not notice that there was a test failure :(

I'll propose a fix in few minutes.

@noefroidevaux noefroidevaux referenced this pull request from a commit in noefroidevaux/rails
@noefroidevaux noefroidevaux Fix pull request #3609 bf6efa8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -123,14 +123,14 @@ def initialize(spec)
# A cached lookup for table existence.
def table_exists?(name)
- return true if @tables.key? name
+ return @tables[name] if @tables.key? name
with_connection do |conn|
conn.tables.each { |table| @tables[table] = true }
- @tables[name] = true if !@tables.key?(name) && conn.table_exists?(name)
+ @tables[name] = !@tables.key?(name) && conn.table_exists?(name)
end
- @tables.key? name
+ @tables[name]
end
# Clears out internal caches:
Something went wrong with that request. Please try again.