Repository navigation
Commit f856112
committed
fix: walk every input and through every aggregate in columns_read_above_aggregate
The old walk stopped at the first Aggregate found top-down and used
any() over the plan's inputs, which short-circuits once one input
returns true. So a read of the NULL-filled column above a stacked
(non-grouping-set) aggregate, in a later join input, or between
nested grouping sets was never collected, wrongly reporting
SafeToExtend and producing wrong rows instead of staying correlated.
Now a node counts as "below a grouping set" when any grouping-set
aggregate is below it specifically (not just any aggregate), every
input is visited unconditionally, and the walk continues through
every aggregate rather than stopping at the first one.
Adds the three repro queries as statement error cases in subquery.slt.1 parent f02e137 commit f856112
2 files changed
Lines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
| 921 | + | |
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
931 | 934 | | |
932 | 935 | | |
933 | 936 | | |
934 | 937 | | |
935 | 938 | | |
936 | 939 | | |
937 | | - | |
938 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
939 | 943 | | |
940 | | - | |
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
944 | 947 | | |
945 | 948 | | |
946 | 949 | | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
947 | 954 | | |
948 | 955 | | |
949 | 956 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2943 | 2943 | | |
2944 | 2944 | | |
2945 | 2945 | | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
2946 | 2965 | | |
2947 | 2966 | | |
2948 | 2967 | | |
| |||
0 commit comments