diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 14:37:24 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 14:39:24 -0600 |
commit | 4c42c89b0482f8ccde625e4d4699cd14f5f20afc (patch) | |
tree | 66df33f707b9823ff782958008eef3e479879f02 /activerecord/lib | |
parent | 0ceaa733aa327e2117c5e059f4cd00126449e8e8 (diff) | |
parent | 1a836b21b93acd6851bcb4f83c8b2678282d9122 (diff) | |
download | rails-4c42c89b0482f8ccde625e4d4699cd14f5f20afc.tar.gz rails-4c42c89b0482f8ccde625e4d4699cd14f5f20afc.tar.bz2 rails-4c42c89b0482f8ccde625e4d4699cd14f5f20afc.zip |
Fix merge conflicts for #18856
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 926b9e6987..59137fb842 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -482,8 +482,16 @@ module ActiveRecord show_variable 'collation_database' end - def tables(name = nil) # :nodoc: - select_values("SHOW FULL TABLES", 'SCHEMA') + def tables(name = nil, database = nil, like = nil) #:nodoc: + database ||= current_database + + sql = "SELECT table_name FROM information_schema.tables " + sql << "WHERE table_schema = #{quote(database)}" + sql << " AND table_name = #{quote(like)}" if like + + execute_and_free(sql, 'SCHEMA') do |result| + result.collect(&:first) + end end alias data_sources tables |