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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:695: Inside #if defined(PG_DEBUG)
   ? "" : PORTALPREFIX   #ifdef PG_DEBUG    +(string)(c->socket->query_fd())+"_"   #endif    +int2hex(pgsqlsess._pportalcount++);    lock=0;   #ifdef PG_DEBUGMORE    PD("ParamValues to bind: %O\n",paramValues);   #endif    Stdio.Buffer plugbuffer=Stdio.Buffer(); -  plugbuffer->add(_portalname)->add_int8(0) -  ->add(_preparedname)->add_int8(0)->add_int16(sizeof(dtoid)); -  plugbuffer->add_ints(map(dtoid,oidformat),2); -  plugbuffer->add_int16(sizeof(dtoid)); +  { array dta=({sizeof(dtoid)}); +  plugbuffer->add(_portalname,0,_preparedname,0) +  ->add_ints(dta+map(dtoid,oidformat)+dta,2); +  }    string cenc=pgsqlsess._runtimeparameter[CLIENT_ENCODING];    foreach(paramValues;int i;mixed value) {    if(undefinedp(value) || objectp(value)&&value->is_val_null)    plugbuffer->add_int32(-1); // NULL    else if(stringp(value) && !sizeof(value)) {    int k=0;    switch(dtoid[i]) {    default:    k=-1; // cast empty strings to NULL for non-string types    case BYTEAOID:
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:982:    catch { // inside destructors, exceptions don't work    _releasesession();    };    }       final void _sendexecute(int fetchlimit,void|bufcon plugbuffer) {    int flushmode;    PD("Execute portal %O fetchlimit %d\n",_portalname,fetchlimit);    if(!plugbuffer)    plugbuffer=c->start(1); -  plugbuffer->add_int8('E')->add_hstring(_portalname,4,8+1) -  ->add_int8(0)->add_int32(fetchlimit); +  plugbuffer->add_int8('E')->add_hstring(({_portalname,0}),4,8) +  ->add_int32(fetchlimit);    if(!fetchlimit)    flushmode=_closeportal(plugbuffer)==SYNCSEND?SYNCSEND:FLUSHSEND;    else    inflight+=fetchlimit, flushmode=FLUSHSEND;    plugbuffer->sendcmd(flushmode,this);    }       //! @returns    //! One result row at a time.    //!