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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:609:    if(!reconnect(1))    { do sleep(RECONNECTBACKOFF);    while(!reconnect(1) && options->reconnect==-1);    }    }    }   }      final int _decodemsg(void|state waitforstate)   { - #ifdef DEBUG + #ifdef PG_DEBUG    { array line; - #ifdef DEBUGMORE + #ifdef PG_DEBUGMORE    line=backtrace();   #endif    PD("Waiting for state %O %O\n",waitforstate,line&&line[sizeof(line)-2]);    }   #endif    while(_mstate!=waitforstate)    { if(_mstate!=unauthenticated)    { if(qstate==cancelpending)    qstate=canceled,sendclose();    if(_c.flushed && qstate==inquery && !_c.bpeek(0))
pike.git/lib/modules/Sql.pmod/pgsql.pike:790:    _mstate=parsecomplete;    break;    case 't':    PD("ParameterDescription (for %s)\n",    _c.portal?_c.portal->_portalname:"DISCARDED");    { array a;    int cols=_c.getint16();    msglen-=4+2+4*cols;    foreach(a=allocate(cols);int i;)    a[i]=_c.getint32(); - #ifdef DEBUGMORE + #ifdef PG_DEBUGMORE    PD("%O\n",a);   #endif    if(_c.portal)    _c.portal->_datatypeoid=a;    _mstate=gotparameterdescription;    break;    }    case 'T':    PD("RowDescription (for %s)\n",    _c.portal?_c.portal->_portalname:"DISCARDED");
pike.git/lib/modules/Sql.pmod/pgsql.pike:818:    res->tableoid=_c.getint32()||UNDEFINED;    res->tablecolattr=_c.getint16()||UNDEFINED;    res->type=_c.getint32();    { int len=_c.getint16();    res->length=len>=0?len:"variable";    }    res->atttypmod=_c.getint32();    res->formatcode=_c.getint16(); // Currently broken in Postgres    a[i]=res;    } - #ifdef DEBUGMORE + #ifdef PG_DEBUGMORE    PD("%O\n",a);   #endif    if(_c.portal)    _c.portal->_datarowdesc=a;    _mstate=gotrowdescription;    break;    }    case 'n':PD("NoData\n");    msglen-=4;    _c.portal->_datarowdesc=({});
pike.git/lib/modules/Sql.pmod/pgsql.pike:1610:   }      final private void sendclose(void|int hold)   { string portalname;    if(!_c)    portalsinflight=unnamedportalinuse=0;    else if(_c.portal && (portalname=_c.portal->_portalname))    { _c.portal->_portalname = UNDEFINED;    _c.setportal();    portalsinflight--; - #ifdef DEBUGMORE + #ifdef PG_DEBUGMORE    PD("Closetrace %O\n",backtrace());   #endif    if(!sizeof(portalname))    unnamedportalinuse--;    if(sizeof(portalname))    { if(!earlyclose)    { PD("Close portal %s\n",portalname);    _c.sendcmd(({"C",_c.plugint32(4+1+sizeof(portalname)+1),    "P",portalname,"\0"}),!hold||portalsinflight?1:0);    }
pike.git/lib/modules/Sql.pmod/pgsql.pike:2007:    }    { array a;int i;    len+=(i=sizeof(a=_c.portal->_datarowdesc))*2;    plugbuf+=({_c.plugint16(i)});    foreach(a;;mapping col)    plugbuf+=({_c.plugint16(oidformat(col->type))});    }    plugbuf[1]=_c.plugint32(len);    PD("Bind portal %s statement %s\n",portalname,preparedname);    _c.sendcmd(plugbuf); - #ifdef DEBUGMORE + #ifdef PG_DEBUGMORE    PD("%O\n",plugbuf);   #endif    }    _c.portal->_statuscmdcomplete=UNDEFINED;    _sendexecute(_fetchlimit    && !(cachealways[q]    || sizeof(q)>=MINPREPARELENGTH && execfetchlimit->match(q))    && FETCHLIMITLONGRUN);    if(tp)    { _decodemsg(bindcomplete);