to get correct count(*), wrap the sql in outer query when there is an atomic aggregate
Authored by: tutasrinivas 2013-01-10
Parent: [r6575]
Child: [r6577]