Skip to content

Commit d3872dd

Browse files
committed
Fix mysql test must contain limit, redefines TYPE_MAP to properly map mysql types
1 parent 05349c2 commit d3872dd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/arjdbc/mysql/adapter.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ def initialize(...)
5858
@connection_parameters ||= @config
5959
end
6060

61+
# NOTE: redefines constant defined in abstract class however this time
62+
# will use methods defined in the mysql abstract class and map properly
63+
# mysql types.
64+
TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) }
65+
6166
def self.database_exists?(config)
6267
conn = ActiveRecord::Base.mysql2_connection(config)
6368
conn && conn.really_valid?

test/db/mysql/schema_dump_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def test_schema_dump_should_not_have_limits_on_date
132132

133133
def test_should_include_limit
134134
text_column = connection.columns('memos').find { |c| c.name == 'text' }
135-
assert_equal 4294967295, text_column.limit
135+
136+
assert_equal 4_294_967_295, text_column.limit
136137
end
137138

138139
def test_should_set_sqltype_to_longtext

0 commit comments

Comments
 (0)