Skip to content

Commit 05335dc

Browse files
committed
[test] set connection properties for MySQL JNDI connection
These must match the normal test setup, otherwise prepared statements (at least) won't work as expected.
1 parent 384a280 commit 05335dc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/db/jndi_mysql_config.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@
1919
data_source.user = MYSQL_CONFIG[:username] if MYSQL_CONFIG[:username]
2020
data_source.password = MYSQL_CONFIG[:password] if MYSQL_CONFIG[:password]
2121

22+
# must set these to match non-jndi setup
23+
data_source.cache_default_timezone = false
24+
data_source.server_timezone = java.util.TimeZone.getDefault.getID
25+
data_source.use_legacy_datetime_code = false
26+
data_source.zero_date_time_behavior = 'convertToNull'
27+
data_source.jdbc_compliant_truncation = false
28+
2229
javax.naming.InitialContext.new.bind JNDI_MYSQL_CONFIG[:jndi], data_source

0 commit comments

Comments
 (0)