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

Add the TABLE_SCHEMA condition to the SELECT statement in table_comment (#25945)

[Rafael Mendonça França + Takeshi AKIMA]
This commit is contained in:
Takeshi AKIMA 2016-07-28 11:19:08 +09:00 committed by Rafael França
parent a64d9835f1
commit ea1dcbbc99
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,7 @@
* Fix the SELECT statement in `#table_comment` for MySQL.
*Takeshi Akima*
* Virtual attributes will no longer raise when read on models loaded from the
database

View file

@ -413,7 +413,8 @@ module ActiveRecord
select_value(<<-SQL.strip_heredoc, 'SCHEMA')
SELECT table_comment
FROM information_schema.tables
WHERE table_name=#{quote(table_name)}
WHERE table_schema=#{quote(current_database)}
AND table_name=#{quote(table_name)}
SQL
end