[SQL] Add average overflow test case from #978

By @egraldlo.