From 612752ab8f762c302af0101291f8576df6cddc14 Mon Sep 17 00:00:00 2001 From: jchrys Date: Sat, 7 Oct 2023 02:34:51 +0900 Subject: [PATCH] Revert "Set LocalDateTime as Default Java Type for TIMESTAMP/DATETIME" (#155) This reverts commit https://github.com/asyncer-io/r2dbc-mysql/commit/15b12b1a6f5c4fce3cf8c7485ed00f3bbc4499f9. Motivation: The previous comit introduced a breaking change without prior notice and minor version change. Modification: Reverts commit https://github.com/asyncer-io/r2dbc-mysql/commit/15b12b1a6f5c4fce3cf8c7485ed00f3bbc4499f9 Result: Resolves https://github.com/asyncer-io/r2dbc-mysql/issues/151 --- .../java/io/asyncer/r2dbc/mysql/constant/MySqlType.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/asyncer/r2dbc/mysql/constant/MySqlType.java b/src/main/java/io/asyncer/r2dbc/mysql/constant/MySqlType.java index aa33e49d4..8628966db 100644 --- a/src/main/java/io/asyncer/r2dbc/mysql/constant/MySqlType.java +++ b/src/main/java/io/asyncer/r2dbc/mysql/constant/MySqlType.java @@ -23,8 +23,8 @@ import java.math.BigInteger; import java.nio.ByteBuffer; import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.ZonedDateTime; /** * Enumeration of MySQL data types. @@ -196,7 +196,7 @@ public int getBinarySize() { * A timestamp type, it will automatically synchronize with the server timezone. It still uses string * format to transfer the timestamp value. */ - TIMESTAMP(MySqlType.ID_TIMESTAMP, LocalDateTime.class), + TIMESTAMP(MySqlType.ID_TIMESTAMP, ZonedDateTime.class), /** * A signed 64-bits integer type. @@ -271,7 +271,7 @@ public int getBinarySize() { /** * A date time type. It does not contain timezone. It uses string format to transfer the value. */ - DATETIME(MySqlType.ID_DATETIME, LocalDateTime.class), + DATETIME(MySqlType.ID_DATETIME, ZonedDateTime.class), /** * A year type. It contains neither leap year information nor timezone.