bug-4473: incorrect result count when having clause is used w/o group by

Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>