Skip to content

Commit

Permalink
Merge pull request duckdb#11143 from hawkfish/fuzzer-timestamptz-range
Browse files Browse the repository at this point in the history
Fuzzer duckdb#2490: Generate NULL TIMESTAMPTZ
  • Loading branch information
Mytherin authored Mar 15, 2024
2 parents 86f853d + a73902b commit 534f3c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension/icu/icu-table-range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<timestamp_t>();
result->end = inputs[1].GetValue<timestamp_t>();
result->increment = inputs[2].GetValue<interval_t>();
Expand Down
17 changes: 17 additions & 0 deletions test/fuzzer/sqlsmith/timestamptz_null_range.test
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 534f3c8

Please sign in to comment.