Sha256: 5fa51a819b44ec8c0801b37dc22f0f14b65160c34be888ce3a47c871b8806fdf

Contents?: true

Size: 909 Bytes

Versions: 8

Compression:

Stored size: 909 Bytes

Contents

# To run this script, run the following in a mysql instance:
#
#   drop database if exists weblog_development;
#   create database weblog_development;
#   grant all on weblog_development.* to blog@localhost;
#   flush privileges;

require 'jdbc_common'
require 'db/mysql'

class MysqlSimpleTest < Test::Unit::TestCase
  include SimpleTestMethods
  include ActiveRecord3TestMethods

  def test_string_quoting_oddity
    s = "0123456789a'a"
    assert_equal "'0123456789a\\'a'", ActiveRecord::Base.connection.quote(s)

    s2 = s[10,3]
    assert_equal "a'a", s2
    assert_equal "'a\\'a'", ActiveRecord::Base.connection.quote(s2)
  end

  def test_table_name_quoting_with_dot
    s = "weblog_development.posts"
    assert_equal "`weblog_development`.`posts`", ActiveRecord::Base.connection.quote_table_name(s)
  end
end

class MysqlHasManyThroughTest < Test::Unit::TestCase
  include HasManyThroughMethods
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
kb-activerecord-jdbc-adapter-0.9.7.1-java test/mysql_simple_test.rb
kb-activerecord-jdbc-adapter-1.0.0.beta1-java test/mysql_simple_test.rb
activerecord-jdbc-adapter-1.0.0.beta1-java test/mysql_simple_test.rb
activerecord-jdbc-adapter-0.9.7-java test/mysql_simple_test.rb
activerecord-jdbc-adapter-0.9.6-java test/mysql_simple_test.rb
activerecord-jdbc-adapter-0.9.5-java test/mysql_simple_test.rb
activerecord-jdbc-adapter-0.9.4-java test/mysql_simple_test.rb
activerecord-jdbc-adapter-0.9.3-java test/mysql_simple_test.rb