Browse files

Bug Fix -- clean up connection after stored procedure [#3151 state:re…

…solved] for 2-3-stable
  • Loading branch information...
1 parent 7e79889 commit d35a67bba3b9b108aff953c6d0221fbcc58c65a2 @Jeff-Lawson Jeff-Lawson committed with tenderlove Aug 18, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 activerecord/test/cases/sp_test_mysql.rb
View
16 activerecord/test/cases/sp_test_mysql.rb
@@ -0,0 +1,16 @@
+require "cases/helper"
+require 'models/topic'
+require 'models/minimalistic'
+
+class StoredProcedureTest < ActiveRecord::TestCase
+ fixtures :topics
+
+ # Test that MySQL allows multiple results for stored procedures
+ if Mysql.const_defined?(:CLIENT_MULTI_RESULTS)
+ def test_multi_results_from_find_by_sql
+ topics = Topic.find_by_sql 'CALL topics();'
+ assert_equal 1, topics.size
+ assert ActiveRecord::Base.connection.active?, "Bad connection use by 'MysqlAdapter.select'"
+ end
+ end
+end

0 comments on commit d35a67b

Please sign in to comment.