From 9cbfbcd236e7dde8858603d25c26a342dc61edd4 Mon Sep 17 00:00:00 2001 From: zhenglinli <1125806272@qq.com> Date: Mon, 31 Jul 2023 11:27:14 +0800 Subject: [PATCH] fix: let DateTime to be valid --- src/sqlancer/stonedb/ast/StoneDBConstant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sqlancer/stonedb/ast/StoneDBConstant.java b/src/sqlancer/stonedb/ast/StoneDBConstant.java index 023ff888a..341ca8d2d 100644 --- a/src/sqlancer/stonedb/ast/StoneDBConstant.java +++ b/src/sqlancer/stonedb/ast/StoneDBConstant.java @@ -144,7 +144,7 @@ public StoneDBDateConstant(long val) { if (validValue < -30609820800000L) { validValue = -30609820800000L; } - Timestamp timestamp = new Timestamp(val); + Timestamp timestamp = new Timestamp(validValue); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); textRepr = dateFormat.format(timestamp); } @@ -178,7 +178,7 @@ public StoneDBTimestampConstant(long val) { if (validValue < -30609820800000L) { validValue = -30609820800000L; } - Timestamp timestamp = new Timestamp(val); + Timestamp timestamp = new Timestamp(validValue); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); textRepr = dateFormat.format(timestamp); }