Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…solved] for 2-3-stable
  • Loading branch information...
commit d35a67bba3b9b108aff953c6d0221fbcc58c65a2 1 parent 7e79889
Jeff-Lawson Jeff-Lawson authored tenderlove committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 activerecord/test/cases/sp_test_mysql.rb
16 activerecord/test/cases/sp_test_mysql.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.