Skip to content

Commit

Permalink
Merge pull request #14 from eflorea/bufix/use-case-insensitive-regex-…
Browse files Browse the repository at this point in the history
…for-datagrid-manual-sql-pregreplace

- Datagrid manual sql bugfixes
  • Loading branch information
eflorea authored Mar 15, 2018
2 parents 67ade7f + d6332a9 commit b1c64ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RPC/Datagrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function fetchRows( $from, $to )
if( $this->manual_sql )
{
$sql = trim( $this->manual_sql );
$sql = preg_replace( '/select /', 'select SQL_CALC_FOUND_ROWS ', $this->manual_sql, 1 );
$sql = preg_replace( '/select (?!SQL_CALC_FOUND_ROWS)/i', 'select SQL_CALC_FOUND_ROWS ', $this->manual_sql, 1 );
}
else
{
Expand Down

0 comments on commit b1c64ea

Please sign in to comment.