I have a SOQL query that uses the IN operator to find some Contacts by Email:
Set<String> emailSet = new Set<String>{.......};
Map<Id, Contact> contactMap = new Map<Id, Contact>([SELECT id, name, email
FROM Contact
WHERE email IN :emailSet
ORDER BY LastModifiedDate DESC LIMIT 150]);
In my test:
if the Email field on the Contact object is not encrypted then I get 7 results but
if the field is encrypted with deterministic encryption then I get just 1 result
Literally the only thing that changes between executions is me marking the field as encrypted or not in Setup. I thought the IN operator can be used on deterministically encrypted fields since it is basically like an = operator on steroids and Salesforce does not throw any error, what is going on here?