diff options
author | Takeshi AKIMA <akm2000@gmail.com> | 2016-07-28 11:19:08 +0900 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-07-27 23:19:08 -0300 |
commit | ea1dcbbc9965f82361f45d5b098207de738d7bb9 (patch) | |
tree | 5fbca7d304dadab90b217880a5b71417083823dd /activerecord/lib/active_record | |
parent | a64d9835f11ea7919fae825bceb91e08a1480766 (diff) | |
download | rails-ea1dcbbc9965f82361f45d5b098207de738d7bb9.tar.gz rails-ea1dcbbc9965f82361f45d5b098207de738d7bb9.tar.bz2 rails-ea1dcbbc9965f82361f45d5b098207de738d7bb9.zip |
Add the TABLE_SCHEMA condition to the SELECT statement in table_comment (#25945)
[Rafael Mendonça França + Takeshi AKIMA]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 3 |
1 files changed, 2 insertions, 1 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 25e3939b62..01395d8ceb 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -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 |