Fix null deference for GROUP BY WITH TOTALS HAVING (when the column from HAVING wasn't selected)

Found by UBsan fuzzer [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/29503/a4f2663b8209e0e75021d8b84f932bc162c81857/fuzzer_ubsan/report.html#fail1
This commit is contained in:
Azat Khuzhin 2021-09-30 10:21:29 +03:00
parent 54ac0801a2
commit 032bb55a01
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,8 @@
-- { echo }
SELECT '' FROM numbers(1) GROUP BY number WITH TOTALS HAVING count(number)>0;
SELECT '' FROM numbers(1) GROUP BY number WITH TOTALS HAVING count(number)<0;

View File

@ -0,0 +1,3 @@
-- { echo }
SELECT '' FROM numbers(1) GROUP BY number WITH TOTALS HAVING count(number)>0;
SELECT '' FROM numbers(1) GROUP BY number WITH TOTALS HAVING count(number)<0;