File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3943,7 +3943,16 @@ impl TableFunc {
3943
3943
// We error if the count is not one,
3944
3944
// and produce no rows if equal to one.
3945
3945
let count = datums[ 0 ] . unwrap_int64 ( ) ;
3946
+ // Note that we can't get a 0 count here, since the `Reduce count` below us is not
3947
+ // an SQL `count`, but an MIR `count`, which has an empty output on an empty input.
3948
+ // If we get a negative count, then we have a negative accumulation error somewhere.
3949
+ soft_assert_or_log ! (
3950
+ count >= 1 ,
3951
+ "GuardSubquerySize encountered invalid count: {}" ,
3952
+ count
3953
+ ) ;
3946
3954
if count != 1 {
3955
+ // TODO(ggevay): Add count to error msg after the old subquery code is gone.
3947
3956
Err ( EvalError :: MultipleRowsFromSubquery )
3948
3957
} else {
3949
3958
Ok ( Box :: new ( [ ] . into_iter ( ) ) )
You can’t perform that action at this time.
0 commit comments