Skip to content

Validate LocalTime result state and track SQL NULL - #923

Merged
staticlibs merged 1 commit into
duckdb:mainfrom
hutiefang76:frank/r2-dd-localtime-state-20261010-01a11186
Oct 10, 2026
Merged

staticlibs merged 1 commit into
duckdb:mainfrom
hutiefang76:frank/r2-dd-localtime-state-20261010-01a11186

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

DuckDBResultSet.getLocalTime bypasses the result-set state and null checks: invalid cursor access can throw runtime exceptions, and reading SQL NULL leaves wasNull() stale. Use the same checkAndNull guard as the other supported getters.

Four regression tests cover nanosecond TIME values, SQL NULL, index and label access, invalid indices, before/after-row access, and closed results. The null and state regressions fail with the original production source. All 33 TestTimestamp tests and 12 TestResults tests pass with freshly compiled Java sources and the cached native driver. clang-format 11 passes; a native rebuild was not performed locally.

AI assistance was used for implementation and test development.

Signed-off-by: hutiefang76 <137664623+hutiefang76@users.noreply.github.com>

@staticlibs staticlibs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks good to me.

@staticlibs
staticlibs merged commit 8089bba into duckdb:main Oct 10, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants