CBQE-1531: add distinct cases

Change-Id: Idde9d562009181eed256e89070763318e30b577e
Reviewed-on: http://review.couchbase.org/29127
Reviewed-by: Iryna Mironava <irynamironava@yandex.ru>
Tested-by: Iryna Mironava <irynamironava@yandex.ru>