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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:903:    return res;    }       protected void create(proxy _pgsqlsess, conxion _c, string query,    int _portalbuffersize, int alltyped, array params, int forcetext,    int _timeout, int _syncparse, int _transtype) {    pgsqlsess = _pgsqlsess;    if (c = _c)    cr = c->i;    else -  losterror(); +  losterror(LOSTERROR);    _query = query;    datarows = Thread.Queue();    _ddescribe = Thread.Condition();    _ddescribemux = MUTEX();    closemux = MUTEX();    portalbuffersize = _portalbuffersize;    alltext = !alltyped;    _params = params;    _forcetext = forcetext;    _state = PORTALINIT;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1022:    //! can still increase between subsequent calls if the results from    //! the query are not complete yet. This function is only guaranteed to    //! return the correct count after EOF has been reached.    //! @seealso    //! @[Sql.Result()->num_rows()]    /*semi*/final int num_rows() {    trydelayederror();    return index;    }    -  private void losterror() { -  string err; +  private void losterror(void|string err) {    if (pgsqlsess) -  err = pgsqlsess->geterror(1); -  error("%s\n", err || LOSTERROR); +  err = pgsqlsess->geterror(1) || err; +  if (err) +  error("%s\n", err);    }       private void trydelayederror() {    if (delayederror)    throwdelayederror(this);    else if (_state == PURGED)    losterror();    }       //! @seealso
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:2528:    portal->_processrowdesc(a, at);    portal = 0;    }    break;    }    case 'n': {   #ifdef PG_DEBUG    msglen -= 4;    PD("NoData %O\n", portal._query);   #endif -  if (!portal._forcetext) { +     portal._fetchlimit = 0; // disables subsequent Executes    portal->_processrowdesc(({}), ({}));    portal = 0; -  } +     break;    }    case 'H':    portal->_processrowdesc(@getcols());    PD("CopyOutResponse %O\n", portal. _query);    break;    case '2': {    mapping tp;   #ifdef PG_DEBUG    msglen -= 4;