diff --git a/src/main/java/org/mariadb/jdbc/Configuration.java b/src/main/java/org/mariadb/jdbc/Configuration.java index 3737ba451..e212310ba 100644 --- a/src/main/java/org/mariadb/jdbc/Configuration.java +++ b/src/main/java/org/mariadb/jdbc/Configuration.java @@ -64,7 +64,7 @@ public class Configuration { // various private String timezone = null; private String connectionTimeZone = null; - private boolean forceConnectionTimeZoneToSession = true; + private Boolean forceConnectionTimeZoneToSession = null; private boolean preserveInstants; private Boolean autocommit = null; private boolean useMysqlMetadata = false; @@ -1600,7 +1600,7 @@ public String connectionTimeZone() { * * @return forceConnectionTimeZoneToSession */ - public boolean forceConnectionTimeZoneToSession() { + public Boolean forceConnectionTimeZoneToSession() { return forceConnectionTimeZoneToSession; } diff --git a/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java b/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java index aeb73bbc2..a2f29253b 100644 --- a/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java +++ b/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java @@ -768,7 +768,7 @@ public String createSessionVariableQuery(Context context) { } // force client timezone to connection to ensure result of now(), ... - if (conf.forceConnectionTimeZoneToSession()) { + if (conf.forceConnectionTimeZoneToSession() == null || conf.forceConnectionTimeZoneToSession()) { TimeZone connectionTz = context.getConnectionTimeZone(); ZoneId connectionZoneId = connectionTz.toZoneId();