Skip to content

Backport to 2.29.x: #10379: Read hypertable max time value with an ordered scan - #10390

Merged
timescale-automation merged 1 commit into
2.29.xfrom
backport/2.29.x/10379
Aug 3, 2026
Merged

Backport to 2.29.x: #10379: Read hypertable max time value with an ordered scan#10390
timescale-automation merged 1 commit into
2.29.xfrom
backport/2.29.x/10379

Conversation

@timescale-automation

Copy link
Copy Markdown
Member

This is an automated backport of #10379: Read hypertable max time value with an ordered scan.
This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore.

For more details, please see the documentation

Original description

Read hypertable max time value with an ordered scan

The max value of a hypertable's open dimension was read with a max()
aggregate. For UUID time columns the aggregate argument is an expression
that extracts the timestamp from the UUID. Because the argument is an
expression and not a plain column, the planner cannot rewrite the
aggregate into a min/max aggregate, so it reads every row instead.

Also lock down search_path for the SPI execution and fix a sql
injection vulnerability in the UUID path.

The max value of a hypertable's open dimension was read with a max()
aggregate. For UUID time columns the aggregate argument is an expression
that extracts the timestamp from the UUID. Because the argument is an
expression and not a plain column, the planner cannot rewrite the
aggregate into a min/max aggregate, so it reads every row instead.

Also lock down search_path for the SPI execution and fix a sql
injection vulnerability in the UUID path.

(cherry picked from commit 800fa71)
@timescale-automation timescale-automation added the is-auto-backport PR created by backport automation label Aug 3, 2026
@timescale-automation
timescale-automation enabled auto-merge (rebase) August 3, 2026 12:44
@timescale-automation
timescale-automation merged commit cd55b77 into 2.29.x Aug 3, 2026
61 of 62 checks passed
@timescale-automation
timescale-automation deleted the backport/2.29.x/10379 branch August 3, 2026 13:02
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/hypertable.c 83.33% 0 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is-auto-backport PR created by backport automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants