From d5dd9f097c80d7d6a66dfcae464a867eeb080fdf Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Sat, 29 Mar 2025 11:08:53 +0100 Subject: [PATCH] Use ROW_NUMBER() windows function if supported Use ROW_NUMBER() window function on MariaDB >= 10.2.0 and MySQL >= 8.0.0 --- src/Query/MysqlQueryBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Query/MysqlQueryBuilder.php b/src/Query/MysqlQueryBuilder.php index 5dc69a78..4bfe378f 100644 --- a/src/Query/MysqlQueryBuilder.php +++ b/src/Query/MysqlQueryBuilder.php @@ -217,8 +217,8 @@ public function findInSet($value, $set) */ public function selectRowNumber($orderBy, $orderColumnAlias) { - // Use parent method with ROW_NUMBER() window function on MariaDB 11.0.0 and newer. - if ($this->db->isMariaDb() && version_compare($this->db->getVersion(), '11.0.0', '>=')) { + // Use parent method with ROW_NUMBER() window function on MariaDB >= 10.2.0 and MySQL >= 8.0.0. + if (version_compare($this->db->getVersion(), $this->mariadb ? '10.2.0' : '8.0.0', '>=')) { return parent::selectRowNumber($orderBy, $orderColumnAlias); }