Plugin Directory

Changeset 436152


Ignore:
Timestamp:
09/11/2011 12:00:04 AM (15 years ago)
Author:
hawk__
Message:

Correct SQL_CALC_FOUND_ROWS handling as it was broken by the latest code reorganisation

Location:
postgresql-for-wordpress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • postgresql-for-wordpress/trunk/pg4wp/driver_pgsql.php

    r436145 r436152  
    130130                error_log("Error running :\n$initial\n---- converted to ----\n$sql\n----\n$err\n---------------------\n", 3, PG4WP_LOG.'pg4wp_errors.log');
    131131       
    132         if( $catchnumrows && $GLOBALS['pg4wp_result'] !== false)
    133         {
    134             $GLOBALS['pg4wp_numrows_query'] = $sql;
    135             if( PG4WP_DEBUG)
    136                 error_log( "Number of rows required for :\n$sql\n---------------------\n", 3, PG4WP_LOG.'pg4wp_NUMROWS.log');
    137         }
    138132        return $GLOBALS['pg4wp_result'];
    139133    }
     
    167161       
    168162        $logto = 'queries';
    169         // This is used to catch the number of rows returned by the last "SELECT" REQUEST
    170         $catchnumrows = false;
    171163        // The end of the query may be protected against changes
    172164        $end = '';
     
    181173            if( false !== strpos($sql, 'SQL_CALC_FOUND_ROWS'))
    182174            {
    183                 $catchnumrows = true;
    184175                $sql = str_replace('SQL_CALC_FOUND_ROWS', '', $sql);
     176                $GLOBALS['pg4wp_numrows_query'] = $sql;
     177                if( PG4WP_DEBUG)
     178                    error_log( "Number of rows required for :\n$sql\n---------------------\n", 3, PG4WP_LOG.'pg4wp_NUMROWS.log');
    185179            }
    186180            elseif( false !== strpos($sql, 'FOUND_ROWS()'))
    187181            {
    188                 // Here we need to convert the latest query into a COUNT query
     182                // Here we convert the latest query into a COUNT query
    189183                $sql = $GLOBALS['pg4wp_numrows_query'];
    190184                // Remove any LIMIT ... clause (this is the blocking part)
  • postgresql-for-wordpress/trunk/readme.txt

    r436146 r436152  
    55Requires at least: 2.5.1
    66Tested up to: 3.2.1
    7 Stable tag: 1.2.1
     7Stable tag: 1.2.2
    88
    99PostgreSQL for WordPress is a special 'plugin' enabling WordPress to be used with a PostgreSQL database.
     
    4343
    4444== Changelog ==
     45
     46= 1.2.2 =
     47* Corrected SQL_CALC_FOUND_ROWS handling, was broken by the latest code reorganisation
    4548
    4649= 1.2.1 =
Note: See TracChangeset for help on using the changeset viewer.