add tests with distinct queries

Change-Id: If4682542d90cafc754ca7f3b2483378b06731e19
Reviewed-on: http://review.couchbase.org/37156
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: buildbot <build@couchbase.com>