-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VALUES table expression malfunctions with MAX #46196
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Comments
mrigger
changed the title
VALUES table expression malfunctions with MAX.
VALUES table expression malfunctions with MAX
Mar 17, 2020
yuzefovich
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
Mar 17, 2020
Looking at optsteps, I think this may be an optbuilder agg issue. |
rytaft
added a commit
to rytaft/cockroach
that referenced
this issue
Mar 26, 2020
Prior to this commit, any aggregate function that had an argument with unknown type was replaced with NULL. This is incorrect for scalar aggregates when the input relation has multiple rows, because after replacement, the query result has the same number of rows as the input relation. It should instead be reduced to a single row. This commit fixes the issue by avoiding replacing the aggregate with NULL. Note that for many aggregates, this change results in an ambiguous function error since the type checking code cannot choose which overload is correct for the unknown type. This is different behavior than Postgres, which defaults to type "text". Fixes cockroachdb#46196 Release justification: this is a low risk, high benefit change to existing functionality. Release note (bug fix): fixed an incorrect query result that could occur when a scalar aggregate was called with a null input.
craig bot
pushed a commit
that referenced
this issue
Mar 30, 2020
46649: sql: fix type checking code for aggregate functions r=rytaft a=rytaft Prior to this commit, any aggregate function that had an argument with unknown type was replaced with `NULL`. This is incorrect for scalar aggregates when the input relation has multiple rows, because after replacement, the query result has the same number of rows as the input relation. It should instead be reduced to a single row. This commit fixes the issue by avoiding replacing the aggregate with `NULL`. Note that for many aggregates, this change results in an ambiguous function error since the type checking code cannot choose which overload is correct for the unknown type. This is different behavior than Postgres, which defaults to type "text". Fixes #46196 Release justification: this is a low risk, high benefit change to existing functionality. Release note (bug fix): fixed an incorrect query result that could occur when a scalar aggregate was called with a null input. Co-authored-by: Rebecca Taft <[email protected]>
rytaft
added a commit
to rytaft/cockroach
that referenced
this issue
Mar 31, 2020
Prior to this commit, any aggregate function that had an argument with unknown type was replaced with NULL. This is incorrect for scalar aggregates when the input relation has multiple rows, because after replacement, the query result has the same number of rows as the input relation. It should instead be reduced to a single row. This commit fixes the issue by avoiding replacing the aggregate with NULL. Note that for many aggregates, this change results in an ambiguous function error since the type checking code cannot choose which overload is correct for the unknown type. This is different behavior than Postgres, which defaults to type "text". Fixes cockroachdb#46196 Release justification: this is a low risk, high benefit change to existing functionality. Release note (bug fix): fixed an incorrect query result that could occur when a scalar aggregate was called with a null input.
rytaft
added a commit
to rytaft/cockroach
that referenced
this issue
Apr 1, 2020
Prior to this commit, any aggregate function that had an argument with unknown type was replaced with NULL. This is incorrect for scalar aggregates when the input relation has multiple rows, because after replacement, the query result has the same number of rows as the input relation. It should instead be reduced to a single row. This commit fixes the issue by avoiding replacing the aggregate with NULL. Note that for many aggregates, this change results in an ambiguous function error since the type checking code cannot choose which overload is correct for the unknown type. This is different behavior than Postgres, which defaults to type "text". Fixes cockroachdb#46196 Release justification: this is a low risk, high benefit change to existing functionality. Release note (bug fix): fixed an incorrect query result that could occur when a scalar aggregate was called with a null input.
rytaft
added a commit
to rytaft/cockroach
that referenced
this issue
Apr 1, 2020
Prior to this commit, any aggregate function that had an argument with unknown type was replaced with NULL. This is incorrect for scalar aggregates when the input relation has multiple rows, because after replacement, the query result has the same number of rows as the input relation. It should instead be reduced to a single row. This commit fixes the issue by avoiding replacing the aggregate with NULL. Note that for many aggregates, this change results in an ambiguous function error since the type checking code cannot choose which overload is correct for the unknown type. This is different behavior than Postgres, which defaults to type "text". Fixes cockroachdb#46196 Release justification: this is a low risk, high benefit change to existing functionality. Release note (bug fix): fixed an incorrect query result that could occur when a scalar aggregate was called with a null input.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Consider the following test case:
Unexpectedly, the query returns two rows, rather than one. This bug seems to occur only when a VALUES expression contains
NULL
values only.The text was updated successfully, but these errors were encountered: