File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,9 +210,18 @@ public function findInSet($value, $set)
210210 *
211211 * @since 2.0.0
212212 * @throws \RuntimeException
213+ *
214+ * @todo Remove this method when the database version requirements have been raised
215+ * to >= 8.0.0 for MySQL and >= 10.2.0 for MariaDB so the ROW_NUMBER() window
216+ * function can be used in any case.
213217 */
214218 public function selectRowNumber ($ orderBy , $ orderColumnAlias )
215219 {
220+ // Use parent method with ROW_NUMBER() window function on MariaDB 11.0.0 and newer.
221+ if ($ this ->db ->isMariaDb () && version_compare ($ this ->db ->getVersion (), '11.0.0 ' , '>= ' )) {
222+ return parent ::selectRowNumber ($ orderBy , $ orderColumnAlias );
223+ }
224+
216225 $ this ->validateRowNumber ($ orderBy , $ orderColumnAlias );
217226
218227 return $ this ->select ("(SELECT @rownum := @rownum + 1 FROM (SELECT @rownum := 0) AS r) AS $ orderColumnAlias " );
You can’t perform that action at this time.
0 commit comments