aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql/sp_test.rb
blob: 3ca2917ca489cd844ffcb3ad15fa9546197ddc45 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














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

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