diff -u b/core/lib/Drupal/Core/Database/Query/Condition.php b/core/lib/Drupal/Core/Database/Query/Condition.php --- b/core/lib/Drupal/Core/Database/Query/Condition.php +++ b/core/lib/Drupal/Core/Database/Query/Condition.php @@ -193,13 +193,7 @@ // don't rely on a broken SQL statement when we would just replace // those characters. if (stripos($condition['operator'], 'UNION') !== FALSE || strpbrk($condition['operator'], '[-\'"();') !== FALSE) { - $this->changed = TRUE; - $this->arguments = []; - // Provide a string which will result into an empty query result. - $this->stringVersion = '( AND 1 = 0 )'; - - trigger_error('Invalid characters in query operator: ' . $condition['operator'], E_USER_ERROR); - return; + throw new InvalidQueryException('Invalid characters in query operator: ' . $condition['operator']); } $operator = $connection->mapConditionOperator($condition['operator']); if (!isset($operator)) {