From 5b72045db39bae0375c932b9e66313a96bffbd81 Mon Sep 17 00:00:00 2001 From: bjoernv Date: Thu, 20 Aug 2020 21:31:32 +0200 Subject: [PATCH] Fix for Bug #100294 (Connector/J produces NPE when saving a Date with prepared statements) the change ensures, that cacheDefaultTimezone and defaultTimeZone are copied in the copy constructor ServerPreparedQueryBindValue(ServerPreparedQueryBindValue copyMe) --- .../java/com/mysql/cj/ServerPreparedQueryBindValue.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/core-impl/java/com/mysql/cj/ServerPreparedQueryBindValue.java b/src/main/core-impl/java/com/mysql/cj/ServerPreparedQueryBindValue.java index 4f6cf04e..c6b2c8cb 100644 --- a/src/main/core-impl/java/com/mysql/cj/ServerPreparedQueryBindValue.java +++ b/src/main/core-impl/java/com/mysql/cj/ServerPreparedQueryBindValue.java @@ -79,6 +79,8 @@ private ServerPreparedQueryBindValue(ServerPreparedQueryBindValue copyMe) { this.bufferType = copyMe.bufferType; this.calendar = copyMe.calendar; this.charEncoding = copyMe.charEncoding; + this.cacheDefaultTimezone = copyMe.cacheDefaultTimezone; + this.defaultTimeZone = copyMe.defaultTimeZone; } @Override