Forgot to remove debugging code in previous commit ...

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436142 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
hawk__
2011-09-10 22:14:28 +00:00
parent 5b7a8973df
commit c9a58af607

View File

@@ -145,15 +145,12 @@
{
// Here we need to convert the latest query into a COUNT query
$sql = $GLOBALS['pg4wp_numrows_query'];
echo '<pre>'.$sql.'</pre>';
// Remove any LIMIT ... clause (this is the blocking part)
$pattern = '/\s+LIMIT.+/';
$sql = preg_replace( $pattern, '', $sql);
echo '<pre>'.$sql.'</pre>';
// Now add the COUNT() statement
$pattern = '/SELECT\s+([^\s]+)\s+(FROM.+)/';
$sql = preg_replace( $pattern, 'SELECT COUNT($1) $2', $sql);
echo '<pre>'.$sql.'</pre>';
}
// Handle COUNT(*)...ORDER BY...