Skip to content

Commit a93a8f1

Browse files
authored
Merge pull request rails#43549 from cgriego/no-select-all-from-information-schema-tables
Don't `SELECT * FROM information_schema.tables`
2 parents 63ff0d7 + bccc4c6 commit a93a8f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def add_options_for_index_columns(quoted_columns, **options)
206206
def data_source_sql(name = nil, type: nil)
207207
scope = quoted_scope(name, type: type)
208208

209-
sql = +"SELECT table_name FROM (SELECT * FROM information_schema.tables "
209+
sql = +"SELECT table_name FROM (SELECT table_name, table_type FROM information_schema.tables "
210210
sql << " WHERE table_schema = #{scope[:schema]}) _subquery"
211211
if scope[:type] || scope[:name]
212212
conditions = []

0 commit comments

Comments
 (0)