SENTRY-392: fix a bug of count(*)