https://bugzilla.wikimedia.org/show_bug.cgi?id=50091

       Web browser: ---
            Bug ID: 50091
           Summary: PostgreSQL misuse of pg_get_result
           Product: MediaWiki
           Version: 1.21.1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Database
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Shortly after upgrading PHP (to 5.4.13) and MediaWiki (to 1.21.1), I saw the
following line in Apache's error log:

[Mon Jun 24 07:39:43 2013] [error] FastCGI: server
"/var/www/localhost/cgi-bin/php.fcgi" stderr: PHP Notice:  pg_send_query():
There are results on this connection. Call pg_get_result() until it returns
FALSE in /var/www/localhost/htdocs/mediawiki/includes/db/DatabasePostgres.php
on line 441

Line 441 is the call to pg_send_query in here:

  public function doQuery( $sql ) {
      if ( function_exists( 'mb_convert_encoding' ) ) {
          $sql = mb_convert_encoding( $sql, 'UTF-8' );
      }
      $this->mTransactionState->check();
      if( pg_send_query( $this->mConn, $sql ) === false ) {
          throw new DBUnexpectedError( $this, "Unable to post new query to
PostgreSQL\n" );
      }
      $this->mLastResult = pg_get_result( $this->mConn );
      $this->mTransactionState->check();
      $this->mAffectedRows = null;
      if ( pg_result_error( $this->mLastResult ) ) {
          return false;
      }
      return $this->mLastResult;
  }

I Googled and found the following thread:
http://www.postgresql.org/message-id/flat/[email protected]#[email protected]

If I understand, PHP has detected that the results of one query are still
pending when a second query is issued.  To prevent this, it wants the results
of each query to be cleared by *polling* pg_get_result() instead of making just
a single call to that function.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to