Problem/Motivation

The module currently has a compatibility issue when used with PostgreSQL.
I get this error if both "Case sensitive" and "Match whole word" are both selected when using postgresql version 16.14 (tested) or higher (also tested)

SQLSTATE[2201B]: Invalid regular expression: 7 ERROR: 
invalid regular expression: quantifier operand invalid: 
SELECT "base_table"."vid" AS "vid", "base_table"."nid" AS "nid"
FROM "c1pgags12dev"."node" "base_table"
INNER JOIN "c1pgags12dev"."node_field_data" "node_field_data"
  ON "node_field_data"."nid" = "base_table"."nid"
INNER JOIN "c1pgags12dev"."node__body" "node__body"
  ON "node__body"."entity_id" = "base_table"."nid"
 AND "node__body"."langcode" = :langcode0 WHERE ("node_field_data"."type" = :db_condition_placeholder_1) 
 AND ("node_field_data"."langcode" = :db_condition_placeholder_2) 
 AND ("node__body"."body_value"::text ~* :db_condition_placeholder_3); 
Array ( [:db_condition_placeholder_1] => empl [:db_condition_placeholder_2] => en [:db_condition_placeholder_3] => (?-i)[[:<:]]tfoot[[:>:]] [:langcode0] => en ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 288 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Proposed resolution

See merge request and/or patch
Support Postgres.

Remaining tasks

Review and test patch.

User interface changes

Allows selecting "Case insensitive" option WITH "Match word" without crashing WSOD.

API changes

None.

Data model changes

None.

Issue fork scanner-3583296

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

liam morland created an issue. See original summary.

joseph.olstad’s picture

ah yes, we just noticed this also.

joseph.olstad’s picture

Assigned: Unassigned » joseph.olstad
joseph.olstad’s picture

StatusFileSize
new1.43 KB

PostgreSQL's documentation specifically says (?c) forces case-sensitive matching even when the surrounding regexp operator requested case-insensitive matching, which is exactly what we need because Drupal converts REGEXP to ~*.

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned
Status: Active » Needs review

This works!

liam morland’s picture

Status: Needs review » Reviewed & tested by the community

Looks good