"Primary" email option in Search Builder behaves as "Any"
Overview
If Primary is selected as the email location in Search Builder, then contacts with a matching email address which is not primary are returned in the search results.
Reproduction steps
- Click on Contacts -> Search Builder.
- Create a search term Contact | Email | Primary | = | <email_address>.
- Click Search.
Current behaviour
Contacts having <email_address> as a non-primary email are returned. Primary seems to function like "Any". Same problem with other operators, e.g. Like, RegEx.
Expected behaviour
Only contacts having a matching email address which is primary should be returned.
Environment information
- CiviCRM: 5.21.0
- PHP: 7.2
- CMS: Drupal 7.69
- Database: MariaDB 10.0
- Web Server: Apache 2.4.41
Comments
The current behavior is useful, but should be called "Any" rather than "Primary", and a working "Primary" option should by provided as well.
Confirmed on demo site