From 377875afe86ec49505ad692b7da40438871cda63 Mon Sep 17 00:00:00 2001 From: Edward Chernenko Date: Mon, 30 Dec 2024 09:39:48 +0300 Subject: [PATCH] (postgres) Replace RLIKE when PostgreSQL is used --- includes/FindEventPagesQuery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/FindEventPagesQuery.php b/includes/FindEventPagesQuery.php index f3c52bf..a99ac52 100644 --- a/includes/FindEventPagesQuery.php +++ b/includes/FindEventPagesQuery.php @@ -109,7 +109,8 @@ public function setTitleRegex( $regex ) { return; } - $this->where[] = 'page_title RLIKE ' . $this->dbr->addQuotes( $regex ); + $rlike = $this->dbr->getType() === 'postgres' ? '~' : 'RLIKE'; + $this->where[] = "page_title $rlike " . $this->dbr->addQuotes( $regex ); } /**