When generating a count query using preg_replace, the replace is case sensitive. While I agree that SQL is easier to read when nicely cased, it isn't necessary for validity. Appending an 'i' to the parameters of the regex makes it more friendly. Line 65 in in includes/pager.inc

    $count_query = preg_replace(array('/SELECT.*?FROM/As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM', ''), $query);

I suggest ammending to this

    $count_query = preg_replace(array('/SELECT.*?FROM/Asi', '/ORDER BY .*/i'), array('SELECT COUNT(*) FROM', ''), $query);

Comments

killes@www.drop.org’s picture

Project: Paging » Drupal core
Version: 4.7.x-1.x-dev » 4.7.4
Component: Code » base system
Status: Active » Closed (won't fix)

Drupal coding standards mandate capitalization for SQL keywords,

elyobo’s picture

Ah, OK. I'll file a bug in the module I found it in :)