Skip to content

Fix add_dimension assertion on NULL hypertable - #10327

Merged
svenklemm merged 2 commits into
timescale:mainfrom
JoongHyuk-Shin:fix/adddim-null-arg-guard
Aug 1, 2026
Merged

svenklemm merged 2 commits into
timescale:mainfrom
JoongHyuk-Shin:fix/adddim-null-arg-guard

Conversation

@JoongHyuk-Shin

@JoongHyuk-Shin JoongHyuk-Shin commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

ts_dimension_add_general read the hypertable argument with a bare PG_GETARG_OID(0),
so a NULL argument left table_relid as InvalidOid and tripped an assertion in ts_dimension_add_internal.
Guard it with GETARG_NOTNULL_OID to reject NULL with a clear error,
matching the dimension argument guard on the line above.

Disable-check: commit-count

@github-actions

Copy link
Copy Markdown

@kpan2034, @akuzm: please review this pull request.

Powered by pull-review

@github-actions
github-actions Bot requested review from akuzm and kpan2034 July 27, 2026 07:06
@JoongHyuk-Shin
JoongHyuk-Shin force-pushed the fix/adddim-null-arg-guard branch from afe5d90 to 93f256e Compare July 27, 2026 07:10
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/dimension.c 0.00% 0 Missing and 1 partial ⚠️

πŸ“’ Thoughts on this report? Let us know!

ts_dimension_add_general read the hypertable argument with a bare
PG_GETARG_OID(0), so a NULL argument left table_relid as InvalidOid
and tripped an assertion in ts_dimension_add_internal. Guard it with
GETARG_NOTNULL_OID to reject NULL with a clear error, matching the
dimension argument guard on the line above.
@JoongHyuk-Shin
JoongHyuk-Shin force-pushed the fix/adddim-null-arg-guard branch from 93f256e to 0564a60 Compare August 1, 2026 03:10
Signed-off-by: Sven Klemm <31455525+svenklemm@users.noreply.github.com>
@svenklemm svenklemm added this to the v2.29.1 milestone Aug 1, 2026
@svenklemm svenklemm added the force-auto-backport Automatically backport this PR or fix of this issue, even if it's not marked as "bug" label Aug 1, 2026
@svenklemm
svenklemm merged commit f757431 into timescale:main Aug 1, 2026
68 of 70 checks passed
@svenklemm

Copy link
Copy Markdown
Member

@JoongHyuk-Shin Thank you for your contribution

timescale-automation pushed a commit that referenced this pull request Aug 1, 2026
ts_dimension_add_general read the hypertable argument with a bare PG_GETARG_OID(0),
so a NULL argument left table_relid as InvalidOid and tripped an assertion in ts_dimension_add_internal.
Guard it with GETARG_NOTNULL_OID to reject NULL with a clear error, matching the dimension argument guard on the line above.

---------

Signed-off-by: Sven Klemm <31455525+svenklemm@users.noreply.github.com>
Co-authored-by: Sven Klemm <31455525+svenklemm@users.noreply.github.com>
(cherry picked from commit f757431)
surister pushed a commit that referenced this pull request Aug 4, 2026
# TimescaleDB Changelog

**Please note: When updating your database, you should connect using
`psql` with the `-X` flag to prevent any `.psqlrc` commands from
accidentally triggering the load of a previous TimescaleDB version.**

## 2.29.1 (2026-08-04)

This release contains performance improvements and bug fixes since the
2.29.0 release and fixes for security vulnerabilities (#10360, #10379,
#10386). You can check the [security
advisory](GHSA-hcfx-29v5-2rcw)
for more information on the vulnerability and the platforms that are
affected. We recommend that you upgrade at the next available
opportunity.

**Bugfixes**
* [#10327](#10327)
Assertion failure in `add_dimension()` when the hypertable argument is
`NULL`
* [#10339](#10339) Fix
crash when deleting from a compressed continuous aggregate source
* [#10340](#10340) Validate
`max_batches` in `compact_chunk()`
* [#10352](#10352) Reset
inherited column and constraint flags on chunks during `attach_chunk()`
* [#10360](#10360) Fix
decompressor crashes with malformed compressed data
* [#10369](#10369) Fix typo
in error message about `MERGE` support on compressed hypertables
* [#10379](#10379) Read
hypertable max time value with an ordered scan
* [#10386](#10386) Add
missing permission checks to internal chunk functions

**Thanks**
* @JoongHyuk-Shin for reporting and fixing `NULL` handling in
`add_dimension()`
* @igor2x for reporting a typo in a `MERGE` support error message
* @mdisec for reporting issues with compressed data validation during
decompression
@timescale-automation timescale-automation added the released-2.29.1 Released in 2.29.1 label Aug 4, 2026
@timescale-automation timescale-automation added the released-2.30.0 Released in 2.30.0 label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported-2.29.x force-auto-backport Automatically backport this PR or fix of this issue, even if it's not marked as "bug" released-2.29.1 Released in 2.29.1 released-2.30.0 Released in 2.30.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants