From 4a4868226fbd516719732de1e4926bb6f06556a6 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Wed, 13 May 2015 15:49:14 +0000 Subject: [PATCH] Backported fix for CORE-4789 - Prohibit ability to cast timestamps that out of valid range to varchar. --- src/jrd/SysFunction.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jrd/SysFunction.cpp b/src/jrd/SysFunction.cpp index 8eda67e5a8..0debbe8cdf 100644 --- a/src/jrd/SysFunction.cpp +++ b/src/jrd/SysFunction.cpp @@ -1648,6 +1648,9 @@ dsc* evlDateAdd(Jrd::thread_db* tdbb, const SysFunction* function, Jrd::jrd_nod* break; } + if (!TimeStamp::isValidTimeStamp(timestamp.value())) + status_exception::raise(Arg::Gds(isc_datetime_range_exceeded)); + EVL_make_value(tdbb, valueDsc, impure); switch (impure->vlu_desc.dsc_dtype)