diff --git a/extension/icu/icu-table-range.cpp b/extension/icu/icu-table-range.cpp index 940b1ef6172..9f466a7d656 100644 --- a/extension/icu/icu-table-range.cpp +++ b/extension/icu/icu-table-range.cpp @@ -90,6 +90,11 @@ struct ICUTableRange { auto &inputs = input.inputs; D_ASSERT(inputs.size() == 3); + for (const auto &value : inputs) { + if (value.IsNull()) { + throw BinderException("RANGE with NULL bounds is not supported"); + } + } result->start = inputs[0].GetValue(); result->end = inputs[1].GetValue(); result->increment = inputs[2].GetValue(); diff --git a/test/fuzzer/sqlsmith/timestamptz_null_range.test b/test/fuzzer/sqlsmith/timestamptz_null_range.test new file mode 100644 index 00000000000..1d44b7c1ab5 --- /dev/null +++ b/test/fuzzer/sqlsmith/timestamptz_null_range.test @@ -0,0 +1,17 @@ +# name: test/fuzzer/sqlsmith/timestamptz_null_range.test +# description: Check range bounds for NULL +# group: [sqlsmith] + +require icu + +require no_extension_autoloading + +statement error +SELECT NULL FROM ( + SELECT 4767 + FROM generate_series(CAST('290309-12-22 (BC) 00:00:00+00' AS TIMESTAMP WITH TIME ZONE), NULL, NULL) + AS t6(c1, c2, c3, c4, c5) + ) + AS t64 +---- +RANGE with NULL bounds is not supported