Bug #81024 HAVING without GROUP BY should imply an aggregation of a single group

Submitted: 9 Apr 2016 19:53 Modified: 9 Apr 2016 21:41
Reporter: David Markovitz Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S5 (Performance)
Version:5.0/5.1/5.5/5.6/5.7 OS:Windows (Microsoft Windows 7 Enterprise Service Pack 1)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[9 Apr 2016 19:53] David Markovitz
Description:
create table t (i int);
insert into t(i) values (1),(2),(3);

The following query returns 3 rows (single column,null values) instead of 1 (single column,null value):

select null from t having 1=1;

How to repeat:
create table t (i int);

insert into t(i) values (1),(2),(3);

select null from t having 1=1;
[9 Apr 2016 21:41] MySQL Verification Team
Thank you for the bug report. Verified as described.
[17 Nov 4:00] Chaithra Marsur Gopala Reddy
Bug#121672 is marked as duplicate of this problem.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.