Skip to content

Commit 26238c6

Browse files
authored
Merge pull request #5 from ovos/hotfix/mysql8-reserved-row_number-keyword
quote "row_number" keyword (reserved in MySQL 8)
2 parents 257715b + 80307d2 commit 26238c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Doctrine/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ public function getLimitSubquery()
18041804
// otherwise limit would be executed after ids are reordered by distinct / group by, and that order cannot be determined.
18051805
if ($driverName == 'mysql') {
18061806
// assign an incremented number to each row with id
1807-
$subquery = 'SELECT @rownum:=@rownum + 1 as row_number,'
1807+
$subquery = 'SELECT @rownum:=@rownum + 1 as ' . $this->_conn->quoteIdentifier('row_number') . ','
18081808
. ' doctrine_subquery_rownum_alias.' . $quotedIdentifierColumnName
18091809
. ' FROM (' . $subquery . ') doctrine_subquery_rownum_alias,'
18101810
. ' (SELECT @rownum := 0) rownum_var';

0 commit comments

Comments
 (0)