File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,9 @@ def mysql_connection(config)
2525 properties = ( config [ :properties ] ||= { } )
2626 properties [ 'zeroDateTimeBehavior' ] ||= 'convertToNull'
2727 properties [ 'jdbcCompliantTruncation' ] ||= 'false'
28- properties [ 'useUnicode' ] ||= 'true'
29- properties [ 'characterEncoding' ] = config [ :encoding ] || 'utf8'
28+ properties [ 'useUnicode' ] = 'true' unless properties . key? ( 'useUnicode' ) # otherwise platform default
29+ encoding = config . key? ( :encoding ) ? config [ :encoding ] : 'utf8'
30+ properties [ 'characterEncoding' ] = encoding if encoding
3031
3132 jdbc_connection ( config )
3233 end
Original file line number Diff line number Diff line change @@ -1260,7 +1260,8 @@ module MultibyteTestMethods
12601260 def setup
12611261 super
12621262 config = ActiveRecord ::Base . connection . config
1263- jdbc_driver = ActiveRecord ::ConnectionAdapters ::JdbcDriver . new ( config [ :driver ] )
1263+ properties = config [ :properties ] || { }
1264+ jdbc_driver = ActiveRecord ::ConnectionAdapters ::JdbcDriver . new ( config [ :driver ] , properties )
12641265 @java_connection = jdbc_driver . connection ( config [ :url ] , config [ :username ] , config [ :password ] )
12651266 @java_connection . setAutoCommit ( true )
12661267 end
You can’t perform that action at this time.
0 commit comments