aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorTristan Dunn <tristanzdunn@gmail.com>2009-08-09 16:22:53 -0400
committerJeremy Kemper <jeremy@bitsweat.net>2009-08-09 14:35:57 -0700
commit1af9bd58a04d14dc727713d2e581fafebc0e1d96 (patch)
tree6e72beab8cf1419aa043d47cf22920ec4d37a759 /activerecord/test
parent202b091373ed4d6c78adc7af5e89a359ff0fff2d (diff)
downloadrails-1af9bd58a04d14dc727713d2e581fafebc0e1d96.tar.gz
rails-1af9bd58a04d14dc727713d2e581fafebc0e1d96.tar.bz2
rails-1af9bd58a04d14dc727713d2e581fafebc0e1d96.zip
No longer require database name for MySQL to allow cross database selects.
[#1122 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapter_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb
index 88136597e3..9463b7b14a 100644
--- a/activerecord/test/cases/adapter_test.rb
+++ b/activerecord/test/cases/adapter_test.rb
@@ -63,6 +63,18 @@ class AdapterTest < ActiveRecord::TestCase
def test_show_nonexistent_variable_returns_nil
assert_nil @connection.show_variable('foo_bar_baz')
end
+
+ def test_not_specifying_database_name_for_cross_database_selects
+ assert_nothing_raised do
+ ActiveRecord::Base.establish_connection({
+ :adapter => 'mysql',
+ :username => 'rails'
+ })
+ ActiveRecord::Base.connection.execute "SELECT activerecord_unittest.pirates.*, activerecord_unittest2.courses.* FROM activerecord_unittest.pirates, activerecord_unittest2.courses"
+ end
+
+ ActiveRecord::Base.establish_connection 'arunit'
+ end
end
if current_adapter?(:PostgreSQLAdapter)