1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #43549 from cgriego/no-select-all-from-information-schema-tables

Don't `SELECT * FROM information_schema.tables`
This commit is contained in:
Ryuta Kamizono 2021-10-28 10:49:14 +09:00 committed by GitHub
commit a93a8f1a56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -206,7 +206,7 @@ module ActiveRecord
def data_source_sql(name = nil, type: nil)
scope = quoted_scope(name, type: type)
sql = +"SELECT table_name FROM (SELECT * FROM information_schema.tables "
sql = +"SELECT table_name FROM (SELECT table_name, table_type FROM information_schema.tables "
sql << " WHERE table_schema = #{scope[:schema]}) _subquery"
if scope[:type] || scope[:name]
conditions = []