From 6bcfef2cfa11ce658e0644c2121b965557c19dd4 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Wed, 30 Mar 2022 14:23:34 +0200 Subject: [PATCH] cql3: fix misleading error message for service level timeouts The error message incorrectly stated that the timeout value cannot be longer than 24h, but it can - the actual restriction is that the value cannot be expressed in units like days or months, which was done in order to significantly simplify the parsing routines (and the fact that timeouts counted in days are not expected to be common). Fixes #10286 Closes #10294 (cherry picked from commit 85e95a8cc39d1ba81e205928e5422e1d9e2e6f9a) --- cql3/statements/sl_prop_defs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cql3/statements/sl_prop_defs.cc b/cql3/statements/sl_prop_defs.cc index f3a7d5ccb5..4158c3b8bd 100644 --- a/cql3/statements/sl_prop_defs.cc +++ b/cql3/statements/sl_prop_defs.cc @@ -43,7 +43,7 @@ void sl_prop_defs::validate() { data_value v = duration_type->deserialize(duration_type->from_string(*repr)); cql_duration duration = static_pointer_cast(duration_type)->from_value(v); if (duration.months || duration.days) { - throw exceptions::invalid_request_exception("Timeout values cannot be longer than 24h"); + throw exceptions::invalid_request_exception("Timeout values cannot be expressed in days/months"); } if (duration.nanoseconds % 1'000'000 != 0) { throw exceptions::invalid_request_exception("Timeout values must be expressed in millisecond granularity");