aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql/sp_test.rb
blob: a3d5110032987b4d8aa08f2a145da76f54312058 (plain) (tree)
1
2
3
4
5
6
7
8
                      

                      
                                                       


                                                                 
                                                                   






                                                                                                 
require "cases/helper"
require 'models/topic'

class StoredProcedureTest < ActiveRecord::MysqlTestCase
  fixtures :topics

  # Test that MySQL allows multiple results for stored procedures
  if defined?(Mysql) && 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