Skip to content
This repository
Browse code

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 authored August 18, 2010 tenderlove committed August 18, 2010

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. 16  activerecord/test/cases/sp_test_mysql.rb
16  activerecord/test/cases/sp_test_mysql.rb
... ...
@@ -0,0 +1,16 @@
  1
+require "cases/helper"
  2
+require 'models/topic'
  3
+require 'models/minimalistic'
  4
+
  5
+class StoredProcedureTest < ActiveRecord::TestCase
  6
+  fixtures :topics
  7
+
  8
+  # Test that MySQL allows multiple results for stored procedures
  9
+  if Mysql.const_defined?(:CLIENT_MULTI_RESULTS)
  10
+    def test_multi_results_from_find_by_sql
  11
+      topics = Topic.find_by_sql 'CALL topics();'
  12
+      assert_equal 1, topics.size
  13
+      assert ActiveRecord::Base.connection.active?, "Bad connection use by 'MysqlAdapter.select'"
  14
+    end
  15
+  end
  16
+end

0 notes on commit d35a67b

Please sign in to comment.
Something went wrong with that request. Please try again.