pike.git / lib / modules / Sql.pmod / pgsql_util.pmod

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:742:    _state = PORTALINIT;    timeout = _timeout;    syncparse = _syncparse;    gottimeout = _pgsqlsess->cancelquery;    c->runningportals[this] = 1;    transtype = _transtype;    }       //! Returns the command-complete status for this query.    //! -  //! @seealso -  //! @[affected_rows()] +  //! @note +  //! This method should normally be called after EOF has been reached. +  //! If it is called before, all unfetched result rows will be discarded.    //!    //! @note    //! This function is PostgreSQL-specific. -  +  //! +  //! @[affected_rows()], @[eof()]    /*semi*/final string status_command_complete() { -  +  if (!statuscmdcomplete) +  while (fetch_row_array());    return statuscmdcomplete;    }       //! Returns the number of affected rows by this query.    //! -  //! @seealso -  //! @[status_command_complete()] +  //! @note +  //! This method should normally be called after EOF has been reached. +  //! If it is called before, all unfetched result rows will be discarded.    //!    //! @note    //! This function is PostgreSQL-specific. -  +  //! +  //! @seealso +  //! @[status_command_complete()], @[eof()]    /*semi*/final int affected_rows() {    int rows; -  if (statuscmdcomplete) -  sscanf(statuscmdcomplete, "%*s %d %d", rows, rows); +  sscanf(status_command_complete(), "%*s %d %d", rows, rows);    return rows;    }       final void _storetiming() {    if (_tprepared) {    _tprepared.trun = gethrtime() - _tprepared.trunstart;    m_delete(_tprepared, "trunstart");    _tprepared = 0;    }    }