You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The time_bucket comparison transformation code assumed the value and the width of the time_bucket comparison expression were both Const. But this was not validated only asserted. This can lead to wrong query results. Found by sqlsmith.
Copy file name to clipboardExpand all lines: test/expected/plan_expand_hypertable-12.out
+41Lines changed: 41 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1391,6 +1391,47 @@ time_bucket exclusion with timestamptz and day interval
1391
1391
Filter: ((time_bucket('@ 1 day'::interval, "time") >= 'Mon Jan 03 00:00:00 2000 PST'::timestamp with time zone) AND (time_bucket('@ 7 days'::interval, "time") <= 'Mon Jan 10 00:00:00 2000 PST'::timestamp with time zone))
1392
1392
(11 rows)
1393
1393
1394
+
\qecho no transformation
1395
+
no transformation
1396
+
:PREFIX SELECT * FROM hyper WHERE time_bucket(10 + floor(random())::int, time) > 10 AND time_bucket(10 + floor(random())::int, time) < 100 AND time < 150 ORDER BY time;
Copy file name to clipboardExpand all lines: test/expected/plan_expand_hypertable-13.out
+41Lines changed: 41 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1391,6 +1391,47 @@ time_bucket exclusion with timestamptz and day interval
1391
1391
Filter: ((time_bucket('@ 1 day'::interval, "time") >= 'Mon Jan 03 00:00:00 2000 PST'::timestamp with time zone) AND (time_bucket('@ 7 days'::interval, "time") <= 'Mon Jan 10 00:00:00 2000 PST'::timestamp with time zone))
1392
1392
(11 rows)
1393
1393
1394
+
\qecho no transformation
1395
+
no transformation
1396
+
:PREFIX SELECT * FROM hyper WHERE time_bucket(10 + floor(random())::int, time) > 10 AND time_bucket(10 + floor(random())::int, time) < 100 AND time < 150 ORDER BY time;
Copy file name to clipboardExpand all lines: test/expected/plan_expand_hypertable-14.out
+41Lines changed: 41 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1391,6 +1391,47 @@ time_bucket exclusion with timestamptz and day interval
1391
1391
Filter: ((time_bucket('@ 1 day'::interval, "time") >= 'Mon Jan 03 00:00:00 2000 PST'::timestamp with time zone) AND (time_bucket('@ 7 days'::interval, "time") <= 'Mon Jan 10 00:00:00 2000 PST'::timestamp with time zone))
1392
1392
(11 rows)
1393
1393
1394
+
\qecho no transformation
1395
+
no transformation
1396
+
:PREFIX SELECT * FROM hyper WHERE time_bucket(10 + floor(random())::int, time) > 10 AND time_bucket(10 + floor(random())::int, time) < 100 AND time < 150 ORDER BY time;
0 commit comments