Test of count by sql fix