Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3609 from noefroidevaux/issue_3595

Prevent multiple SHOW TABLES calls when a table don't exists in database...
  • Loading branch information...
commit 1c6d6b637e5477ab476916ac86b5af57d7f4a706 2 parents 7352efa + 27c5800
@tenderlove tenderlove authored
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:
Please sign in to comment.
Something went wrong with that request. Please try again.