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 previous guard only fired when creating a continuous aggregate.
The cagg rewrite planner hook calls the same parameter handler with
is_cagg_create=false, so a NULL interval width passed straight through
and later crashed in time_bucket_info_has_fixed_width when it read
bf->bucket_time_width->month.
Bail out as soon as we see a NULL width, raise the error for any
non-rewrite caller, and let the rewrite path simply skip rewriting
because bf->bucket_function stays unset.
Found by the LLM fuzzer.
psql:include/cagg_rewrites_error.sql:126: INFO: Query cannot be rewritten with CAggs: using offset and origin in a time_bucket function at the same time is not supported
774
+
psql:include/cagg_rewrites_error.sql:134: INFO: Query cannot be rewritten with CAggs: using offset and origin in a time_bucket function at the same time is not supported
psql:include/cagg_rewrites_error.sql:146: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
800
+
psql:include/cagg_rewrites_error.sql:154: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
789
801
Caggs are not real-time: "public.cagg_view"
790
802
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
791
803
Joins do not match: "public.cagg_join" "public.cagg_more_conds" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:152: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
815
+
psql:include/cagg_rewrites_error.sql:160: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
804
816
Caggs are not real-time: "public.cagg_view"
805
817
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
806
818
Joins do not match: "public.cagg_join" "public.cagg_more_conds" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:159: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
831
+
psql:include/cagg_rewrites_error.sql:167: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
820
832
Caggs are not real-time: "public.cagg_view"
821
833
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
822
834
Joins do not match: "public.cagg_join" "public.cagg_more_conds" "public.cagg_lateral"
@@ -834,7 +846,7 @@ FROM conditions
834
846
GROUP BY bucket
835
847
HAVING count(device_id) > 0
836
848
ORDER BY 1 LIMIT 1;
837
-
psql:include/cagg_rewrites_error.sql:168: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
849
+
psql:include/cagg_rewrites_error.sql:176: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
838
850
Buckets do not match: "public.cagg1" "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg_join" "public.cagg_more_conds" "public.cagg_view" "public.cagg_lateral"
839
851
HAVING quals do not match: "public.cagg3"
840
852
@@ -854,7 +866,7 @@ WHERE location_id > 1 AND
854
866
conditions.temperature > 28
855
867
GROUP BY devices.name, bucket, devices.device_id
856
868
ORDER BY 1 LIMIT 1;
857
-
psql:include/cagg_rewrites_error.sql:181: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
869
+
psql:include/cagg_rewrites_error.sql:189: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
858
870
Caggs are not real-time: "public.cagg_view"
859
871
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
860
872
Joins do not match: "public.cagg1" "public.cagg_join" "public.cagg_lateral"
@@ -875,7 +887,7 @@ WHERE location_id > 1 AND
875
887
conditions.temperature < 20
876
888
GROUP BY devices.name, bucket, devices.device_id
877
889
ORDER BY 1 LIMIT 1;
878
-
psql:include/cagg_rewrites_error.sql:193: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
890
+
psql:include/cagg_rewrites_error.sql:201: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
879
891
Caggs are not real-time: "public.cagg_view"
880
892
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
881
893
Joins do not match: "public.cagg1" "public.cagg_join" "public.cagg_lateral"
@@ -896,7 +908,7 @@ WHERE location_id > 1 AND
896
908
GROUP BY devices.name, bucket, devices.device_id
897
909
ORDER BY 1,2,3,4
898
910
LIMIT 2;
899
-
psql:include/cagg_rewrites_error.sql:206: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
911
+
psql:include/cagg_rewrites_error.sql:214: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
900
912
Caggs are not real-time: "public.cagg_view"
901
913
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
902
914
Joins do not match: "public.cagg1" "public.cagg_join" "public.cagg_lateral"
@@ -920,7 +932,7 @@ WHERE location_id < 1 AND
920
932
GROUP BY devices.name, bucket, devices.device_id
921
933
ORDER BY 1,2,3,4
922
934
LIMIT 2;
923
-
psql:include/cagg_rewrites_error.sql:220: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
935
+
psql:include/cagg_rewrites_error.sql:228: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
924
936
Caggs are not real-time: "public.cagg_view"
925
937
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
926
938
Joins do not match: "public.cagg1" "public.cagg_join" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:228: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
951
+
psql:include/cagg_rewrites_error.sql:236: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
940
952
Buckets do not match: "public.cagg1" "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3" "public.cagg_join" "public.cagg_more_conds" "public.cagg_view" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:236: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
967
+
psql:include/cagg_rewrites_error.sql:244: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
956
968
Buckets do not match: "public.cagg1" "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3" "public.cagg_join" "public.cagg_more_conds" "public.cagg_view" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:244: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
983
+
psql:include/cagg_rewrites_error.sql:252: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
972
984
Buckets do not match: "public.cagg1" "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3" "public.cagg_join" "public.cagg_more_conds" "public.cagg_view" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:252: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
999
+
psql:include/cagg_rewrites_error.sql:260: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
988
1000
Buckets do not match: "public.cagg1" "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3" "public.cagg_join" "public.cagg_more_conds" "public.cagg_view" "public.cagg_lateral"
psql:include/cagg_rewrites_error.sql:259: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
1014
+
psql:include/cagg_rewrites_error.sql:267: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
1003
1015
Buckets do not match: "public.cagg1" "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3" "public.cagg_join" "public.cagg_more_conds" "public.cagg_view" "public.cagg_lateral"
1004
1016
1005
1017
bucket | avg | device_id
@@ -1014,7 +1026,7 @@ SELECT time_bucket(3, day, 2) AS bucket,
1014
1026
count(device_id)
1015
1027
FROM conditions_int
1016
1028
GROUP BY bucket ORDER BY 1, 2, 3;
1017
-
psql:include/cagg_rewrites_error.sql:266: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions_int" are matching the query:
1029
+
psql:include/cagg_rewrites_error.sql:274: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions_int" are matching the query:
1018
1030
Buckets do not match: "public.cagg3_int"
1019
1031
1020
1032
bucket | avg | count
@@ -1031,7 +1043,7 @@ SELECT time_bucket(3, day) AS bucket,
1031
1043
count(device_id)
1032
1044
FROM conditions_int
1033
1045
GROUP BY bucket ORDER BY 1, 2, 3;
1034
-
psql:include/cagg_rewrites_error.sql:272: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions_int" are matching the query:
1046
+
psql:include/cagg_rewrites_error.sql:280: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions_int" are matching the query:
WHERE devices.device_id = cagg1.device_id AND devices.device_id > 1
1050
1062
GROUP BY 1 ORDER BY 1 LIMIT 1;
1051
-
psql:include/cagg_rewrites_error.sql:279: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.cagg1" are matching the query:
1063
+
psql:include/cagg_rewrites_error.sql:287: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.cagg1" are matching the query:
1052
1064
WHERE/JOIN quals do not match: "public.cagg_on_cagg1"
1053
1065
1054
1066
bucket | temperature
@@ -1069,7 +1081,7 @@ GROUP BY devices.name, bucket, devices.device_id
1069
1081
ORDER BY 1,2,3,4
1070
1082
LIMIT 2;
1071
1083
EXECUTE prep1(28);
1072
-
psql:include/cagg_rewrites_error.sql:295: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
1084
+
psql:include/cagg_rewrites_error.sql:303: INFO: Query cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
1073
1085
Caggs are not real-time: "public.cagg_view"
1074
1086
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
1075
1087
Joins do not match: "public.cagg1" "public.cagg_join" "public.cagg_lateral"
@@ -1094,7 +1106,7 @@ GROUP BY devices.name, bucket, devices.device_id
1094
1106
ORDER BY 1,2,3,4
1095
1107
LIMIT 2;
1096
1108
EXECUTE prep2(INTERVAL '1 day');
1097
-
psql:include/cagg_rewrites_error.sql:311: INFO: Query cannot be rewritten with CAggs: non-immutable expression as first argument to the time bucket function
1109
+
psql:include/cagg_rewrites_error.sql:319: INFO: Query cannot be rewritten with CAggs: non-immutable expression as first argument to the time bucket function
GROUP BY devices.name, bucket, devices.device_id) q
1116
1128
ORDER BY 1,2,3,4
1117
1129
LIMIT 2;
1118
-
psql:include/cagg_rewrites_error.sql:327: INFO: Query cannot be rewritten with CAggs: no GROUP BY clause in the query
1119
-
psql:include/cagg_rewrites_error.sql:327: INFO: Subquery "a" cannot be rewritten with CAggs: no GROUP BY clause in the query
1120
-
psql:include/cagg_rewrites_error.sql:327: INFO: Subquery "q" cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
1130
+
psql:include/cagg_rewrites_error.sql:335: INFO: Query cannot be rewritten with CAggs: no GROUP BY clause in the query
1131
+
psql:include/cagg_rewrites_error.sql:335: INFO: Subquery "a" cannot be rewritten with CAggs: no GROUP BY clause in the query
1132
+
psql:include/cagg_rewrites_error.sql:335: INFO: Subquery "q" cannot be rewritten with CAggs: none of continuous aggregates defined on "public.conditions" are matching the query:
1121
1133
Caggs are not real-time: "public.cagg_view"
1122
1134
Buckets do not match: "public.cagg1_tz" "public.cagg1_origin" "public.cagg2" "public.cagg3"
1123
1135
Joins do not match: "public.cagg1" "public.cagg_join" "public.cagg_lateral"
0 commit comments