Problem/Motivation
\Drupal\user\Plugin\EntityReferenceSelection\UserSelection::entityQueryAlter()
does a str_replace()
on sql without accounting for the underlying escaping strategy.
Proposed resolution
Use escapeField()
This is not testable but if all identifiers are quoted as per #2986452: Database reserved keywords need to be quoted as per the ANSI standard then this will become a problem. It already is a problem for contrib or custom db drivers that do anything interesting in escapeField().