issue #21229: support count queries