Skip to content
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

Make sure to handle COUNT and SUM with DISTINCT columns with empty input #5097

Merged
merged 4 commits into from Aug 17, 2019

Conversation

systay
Copy link
Collaborator

@systay systay commented Aug 14, 2019

No description provided.

Signed-off-by: Andres Taylor <antaylor@squareup.com>
Signed-off-by: Andres Taylor <antaylor@squareup.com>
Signed-off-by: Andres Taylor <antaylor@squareup.com>
Signed-off-by: Andres Taylor <antaylor@squareup.com>
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the assert.

This does look like it will address all corner cases of #5036. @mpawliszyn: can you verify?

@sougou sougou merged commit a7983a3 into vitessio:master Aug 17, 2019
func createEmptyValueFor(opcode AggregateOpcode) (sqltypes.Value, error) {
switch opcode {
case AggregateCountDistinct:
return sqltypes.NULL, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crap @systay I think these are reversed no? We want count to always return non null.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a PR to fix it:
#5121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants