Fixed bug #13529: DISTINCT should not be used as a function