Sha256: c1c0c5491414cf0c1946888b1de5832b706cb9aaeddd40ddbac4b3134bdeb97c

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

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

module ActiveRecord
  module ConnectionAdapters
    class Mysql2Adapter
      class BindParameterTest < ActiveRecord::Mysql2TestCase
        fixtures :topics

        def test_update_question_marks
          str       = "foo?bar"
          x         = Topic.first
          x.title   = str
          x.content = str
          x.save!
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end

        def test_create_question_marks
          str = "foo?bar"
          x   = Topic.create!(:title => str, :content => str)
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end

        def test_update_null_bytes
          str       = "foo\0bar"
          x         = Topic.first
          x.title   = str
          x.content = str
          x.save!
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end

        def test_create_null_bytes
          str = "foo\0bar"
          x   = Topic.create!(:title => str, :content => str)
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-5.1.0 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-5.0.5 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-5.0.4 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-5.0.3 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-5.0.2 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-4.0.0-x86-mingw32 test/cases/adapters/mysql2/bind_parameter_test.rb
ibm_db-4.0.0 test/cases/adapters/mysql2/bind_parameter_test.rb