Skip to content

Commit

Permalink
recognize new mariadb specific queries in WordPressDbStatement
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Dec 23, 2024
1 parent d1f5293 commit f7201ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/WpMatomo/Db/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,11 @@ public function query( $sql, $bind = array() ) {
$test_sql = trim( $test_sql );
}

if ( preg_match( '/^\s*(select)\s/i', $test_sql ) ) {
// WordPress does not fetch any result when doing a select... it's only supposed to be used for things like
if (
preg_match( '/^\s*(select)\s/i', $test_sql )
|| preg_match( '/\sfor select\s/i', $test_sql )
) {
// WordPress does not fetch any result when doing a query w/ a select... it's only supposed to be used for things like
// insert / update / drop ...
$result = $this->fetchAll( $sql, $bind );
} else {
Expand Down

0 comments on commit f7201ea

Please sign in to comment.