mirror of
https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress.git
synced 2025-08-02 19:14:27 +02:00
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:
@@ -145,15 +145,12 @@
|
|||||||
{
|
{
|
||||||
// Here we need to convert the latest query into a COUNT query
|
// Here we need to convert the latest query into a COUNT query
|
||||||
$sql = $GLOBALS['pg4wp_numrows_query'];
|
$sql = $GLOBALS['pg4wp_numrows_query'];
|
||||||
echo '<pre>'.$sql.'</pre>';
|
|
||||||
// Remove any LIMIT ... clause (this is the blocking part)
|
// Remove any LIMIT ... clause (this is the blocking part)
|
||||||
$pattern = '/\s+LIMIT.+/';
|
$pattern = '/\s+LIMIT.+/';
|
||||||
$sql = preg_replace( $pattern, '', $sql);
|
$sql = preg_replace( $pattern, '', $sql);
|
||||||
echo '<pre>'.$sql.'</pre>';
|
|
||||||
// Now add the COUNT() statement
|
// Now add the COUNT() statement
|
||||||
$pattern = '/SELECT\s+([^\s]+)\s+(FROM.+)/';
|
$pattern = '/SELECT\s+([^\s]+)\s+(FROM.+)/';
|
||||||
$sql = preg_replace( $pattern, 'SELECT COUNT($1) $2', $sql);
|
$sql = preg_replace( $pattern, 'SELECT COUNT($1) $2', $sql);
|
||||||
echo '<pre>'.$sql.'</pre>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle COUNT(*)...ORDER BY...
|
// Handle COUNT(*)...ORDER BY...
|
||||||
|
Reference in New Issue
Block a user