Skip to content

Commit 5c1e244

Browse files
committed
[mysql] disable date-time parsing string sync
no need for the (Conn/J) driver to waste time on parsing
1 parent f73835d commit 5c1e244

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/arjdbc/mysql/connection_methods.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def mysql_connection(config)
6767
# with reconnect fail-over sets connection read-only (by default)
6868
# properties['failOverReadOnly'] ||= 'false'
6969
end
70+
properties['noDatetimeStringSync'] = true unless properties.key?('noDatetimeStringSync')
7071
end
7172
if config[:sslkey] || sslcert = config[:sslcert] # || config[:use_ssl]
7273
properties['useSSL'] ||= true # supported by MariaDB as well
@@ -89,11 +90,12 @@ def mysql_connection(config)
8990
properties['localSocket'] ||= socket if mariadb_driver
9091
end
9192

93+
# properties['useJDBCCompliantTimezoneShift'] ||= true
9294
# for the Connector/J 5.1 line this is true by default - but it requires some really nasty
9395
# quirks to get casted Time values extracted properly according for AR's default_timezone
9496
# - thus we're turning it off (should be off in newer driver versions >= 6 anyway)
9597
# + also MariaDB driver is compilant and we would need to branch out based on driver
96-
properties['useLegacyDatetimeCode'] = false
98+
properties['useLegacyDatetimeCode'] = false # disables the effect of 'useTimezone'
9799

98100
jdbc_connection(config)
99101
end

0 commit comments

Comments
 (0)