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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:505: Inside #if defined(PG_DEBUG)
   final int queueoutidx;    final int queueinidx = -1;   #endif       private inline void queueup(Result portal) {    qportals->write(portal); portal->_synctransact = synctransact;    PD("%d>%O %d %d Queue portal %d bytes\n", socket->query_fd(),    portal._portalname, ++queueoutidx, synctransact, sizeof(this));    }    -  final bufcon|conxsess start(void|int|array(Thread.MutexKey) waitforreal) { +  final bufcon|conxsess|zero start(void|int|array(Thread.MutexKey) waitforreal) +  {    Thread.MutexKey lock;   #ifdef PG_DEBUGRACE    if (nostash->current_locking_thread())    PD("Nostash locked by %s\n",    describe_backtrace(nostash->current_locking_thread()->backtrace()));   #endif    while (lock = nostash    && ((intp(waitforreal) && waitforreal > 0    ? nostash->lock : nostash->trylock)(1))) {    int mode;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1808:    }       //! @returns    //! One result row at a time.    //!    //! When using COPY FROM STDOUT, this method returns one row at a time    //! as a single string containing the entire row.    //!    //! @seealso    //! @[eof()], @[send_row()] -  /*semi*/final array(mixed) fetch_row() { +  /*semi*/final array(mixed)|zero fetch_row() {    int|array datarow;    if (!this) // If object already destructed, return fast    return 0;    replenishrows();    if (arrayp(datarow = datarows->try_read()))    return datarow;    if (!eoffound) {    if (!datarow) {    PD("%O Block for datarow\n", _portalname);    array cid = setuptimeout();
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1841:    }       //! @returns    //! Multiple result rows at a time (at least one).    //!    //! When using COPY FROM STDOUT, this method returns one row at a time    //! as a single string containing the entire row.    //!    //! @seealso    //! @[eof()], @[fetch_row()] -  /*semi*/final array(array(mixed)) fetch_row_array() { +  /*semi*/final array(array(mixed))|zero fetch_row_array() {    if (eoffound)    return 0;    replenishrows();    array(array|int) datarow = datarows->try_read_array();    if (!sizeof(datarow)) {    array cid = setuptimeout();    PT(datarow = datarows->read_array());    if (!this) // If object already destructed, return fast    return 0;    scuttletimeout(cid);
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1895:    }       private void run_result_cb(    function(Result, array(mixed), mixed ...:void) callback,    array(mixed) args) {    int|array datarow;    for (;;) {    array cid = setuptimeout();    PT(datarow = datarows->read());    if (!this) // If object already destructed, return fast -  return 0; +  return;    scuttletimeout(cid);    if (!arrayp(datarow))    break;    callout(callback, 0, this, datarow, @args);    }    eoffound = 1;    callout(callback, 0, this, 0, @args);    }       //! Sets up a callback for every row returned from the database.
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1926:    }       private void run_result_array_cb(    function(Result, array(array(mixed)), mixed ...:void) callback,    array(mixed) args) {    array(array|int) datarow;    for (;;) {    array cid = setuptimeout();    PT(datarow = datarows->read_array());    if (!this) // If object already destructed, return fast -  return 0; +  return;    scuttletimeout(cid);    if (!datarow || !arrayp(datarow[-1]))    break;    callout(callback, 0, this, datarow, @args);    }    eoffound = 1;    if (sizeof(datarow)>1)    callout(callback, 0, this, datarow = datarow[..<1], @args);    callout(callback, 0, this, 0, @args);    }