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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:203:    clients[client] = 1;    if (startbackend)    Thread.Thread(run_local_backend);   }      final void throwdelayederror(Result|proxy parent) {    if (mixed err = parent->delayederror) {    if (!objectp(parent->pgsqlsess))    parent->untolderror = 0;    else if (parent->pgsqlsess) -  parent->pgsqlsess->untolderror = 0; -  parent.delayederror = 0; +  parent->pgsqlsess->untolderror = parent->pgsqlsess->delayederror = 0; +  parent->delayederror = 0;    if (stringp(err))    err = ({err, backtrace()[..<2]});    throw(err);    }   }      private int readoidformat(int oid) {    switch (oid) {    case BOOLOID:    case BYTEAOID:
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1687:    inflight--;    if (_state < CLOSED)    datarows->write(datarow);    if (++index == 1)    PD("<%O _fetchlimit %d=min(%d||1,%d), inflight %d\n", _portalname,    _fetchlimit, (portalbuffersize >> 1) * index / bytesreceived,    pgsqlsess._fetchlimit, inflight);    replenishrows();    }    -  private void releaseconditions() { +  private void releaseconditions(void|int aborted) {    _unnamedportalkey = _unnamedstatementkey = 0;    if (!datarowtypes) {    if (_state != PURGED && !delayederror)    delayederror = LOSTERROR;    datarowtypes = ({});    _ddescribe->broadcast();    } -  if (delayederror && pgsqlsess && !pgsqlsess.delayederror) +  if (aborted && delayederror && pgsqlsess && !pgsqlsess.delayederror)    pgsqlsess.delayederror = delayederror; // Preserve error upstream -  pgsqlsess = 0; +  pgsqlsess = 0; // Sever connection to upstream    }       final void _releasesession(void|string statusccomplete) {    c->runningportals[this] = 0;    if (statusccomplete && !statuscmdcomplete) {    Thread.MutexKey lock = _ddescribemux->lock();    statuscmdcomplete = statusccomplete;    _ddescribe->broadcast();    }    inflight = 0;    conxsess plugbuffer;    array(Thread.MutexKey) reflock = ({closemux->lock()});    if (!catch(plugbuffer = c->start()))    plugbuffer->sendcmd(_closeportal(plugbuffer, reflock));    reflock[0] = 0;    if (_state < CLOSED) {    stmtifkey = 0;    _state = CLOSED;    }    datarows->write(1); // Signal EOF -  releaseconditions(); +  releaseconditions(statusccomplete == "ABORT");    }       protected void _destruct() {    catch { // inside destructors, exceptions don't work    _releasesession("ABORT");    };    }       final int _sendexecute(int fetchlimit,    void|array(Thread.MutexKey)|bufcon|conxsess plugbuffer) {
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1934:    final int(0..1) intransaction;       final conxion c;    private string cancelsecret;    private int backendpid;    final int(-128..127) backendstatus;    final mapping(string:mixed) options;    private array(string) lastmessage = ({});    final int(0..1) clearmessage;    final int(0..1) untolderror; +  final mixed delayederror;    private mapping(string:array(mixed)) notifylist = ([]);    final mapping(string:string) runtimeparameter;    final mapping(string:mapping(string:mixed)) prepareds = ([]);    final int pportalcount;    final int totalhits;    final int msgsreceived; // Number of protocol messages received    final int bytesreceived; // Number of bytes received    final int warningsdropcount; // Number of uncollected warnings    private int warningscollected;    final int(0..1) invalidatecache;    private Thread.Queue qportals; -  final mixed delayederror; +     final function (:void) readyforquery_cb;       final string host;    final int(0..65535) port;    final string database, user, pass;    private Crypto.Hash.SCRAM SASLcontext;    final Thread.Condition waitforauthready;    final MUTEX shortmux;    final int readyforquerycount;