Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@azat
Copy link
Member

@azat azat commented Sep 30, 2021

Found by UBsan fuzzer 1.

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected)

Detailed description / Documentation draft:

Fixes: #29475 (cc @KochetovNicolai )
Fixes: #29687

NOTE: marked as Not for changelog since original PR is not included into any release yet
UPD: have to mark it as Bug fix since orignial PR was a Bug fix

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 30, 2021
@azat azat force-pushed the group-by-with-totals-having-fix branch from 1bdc868 to ce8c9be Compare September 30, 2021 07:58
@azat azat changed the title Fix null deference for GROUP BY WITH TOTALS HAVING Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected) Sep 30, 2021
@azat azat marked this pull request as draft September 30, 2021 07:59
@robot-clickhouse robot-clickhouse added pr-bugfix Pull request with bugfix, not backported by default and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Sep 30, 2021
@azat azat force-pushed the group-by-with-totals-having-fix branch from ce8c9be to 032bb55 Compare September 30, 2021 08:35
@KochetovNicolai KochetovNicolai marked this pull request as ready for review September 30, 2021 13:48
@KochetovNicolai KochetovNicolai self-assigned this Sep 30, 2021
}

num_rows = columns.front()->size();
num_rows = columns.empty() ? countBytesInFilter(*filter_description.data) : columns.front()->size();
Copy link
Member Author

Choose a reason for hiding this comment

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

Egh, I submitted PR w/o real fix, anyway you fix looks better, thanks!

P.S. I was going to fix this by removing filter_column_name at the end.

@alexey-milovidov alexey-milovidov merged commit 325a01f into ClickHouse:master Oct 4, 2021
@azat azat deleted the group-by-with-totals-having-fix branch October 4, 2021 08:05
robot-clickhouse pushed a commit that referenced this pull request Oct 4, 2021
…HAVING (when the column from HAVING wasn't selected)
robot-clickhouse pushed a commit that referenced this pull request Oct 4, 2021
…HAVING (when the column from HAVING wasn't selected)
robot-clickhouse pushed a commit that referenced this pull request Oct 4, 2021
… HAVING (when the column from HAVING wasn't selected)
robot-clickhouse pushed a commit that referenced this pull request Oct 4, 2021
…HAVING (when the column from HAVING wasn't selected)
robot-clickhouse pushed a commit that referenced this pull request Oct 4, 2021
…HAVING (when the column from HAVING wasn't selected)
alexey-milovidov added a commit that referenced this pull request Oct 16, 2021
Backport #29553 to 21.10: Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected)
KochetovNicolai added a commit that referenced this pull request Oct 20, 2021
Backport #29553 to 21.8: Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected)
alexey-milovidov added a commit that referenced this pull request Oct 23, 2021
Backport #29553 to 21.9: Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected)
alexey-milovidov added a commit that referenced this pull request Oct 23, 2021
Backport #29553 to 21.3: Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UBSan: TotalsHavingTransform: reference binding to null pointer of type 'COW::immutable_ptr'

4 participants