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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:591:   }      final void _processloop(.pgsql_util.conxion ci) {    int terminating=0;    .pgsql_util.conxiin cr=ci->i;    int|.pgsql_util.sql_result portal;    mixed err;    {    Stdio.Buffer plugbuffer=Stdio.Buffer()->add_int32(PG_PROTOCOL(3,0));    if(user) -  plugbuffer->add("user\0")->add(user)->add_int8(0); +  plugbuffer->add("user\0",user,0);    if(database) -  plugbuffer->add("database\0")->add(database)->add_int8(0); +  plugbuffer->add("database\0",database,0);    _options.reconnect=undefinedp(_options.reconnect) || _options.reconnect;    foreach(_options-.pgsql_util.censoroptions; string name; mixed value) -  plugbuffer->add(name)->add_int8(0)->add((string)value)->add_int8(0); +  plugbuffer->add(name,0,(string)value,0);    plugbuffer->add_int8(0);    PD("%O\n",(string)plugbuffer);    if(catch(ci->start()->add_hstring(plugbuffer,4,4)->sendcmd(SENDOUT))) {   #ifdef PG_DEBUG    if(!_options)    PD("_options is zero, %O\n",this);   #endif    if(_options && _options.reconnect) // FIXME why can _options be 0?    _connectfail();    else
pike.git/lib/modules/Sql.pmod/pgsql.pike:750:   #endif    break;    default:    PD("Unknown Authentication Method %c\n",authtype);    errtype=PROTOCOLUNSUPPORTED;    break;    }    switch(errtype) {    case NOERROR:    if(cancelsecret!="") -  ci->start()->add_int8('p')->add_hstring(sendpass,4,5) -  ->add_int8(0)->sendcmd(SENDOUT); +  ci->start()->add_int8('p')->add_hstring(({sendpass,0}),4,4) +  ->sendcmd(SENDOUT);    break; // No flushing here, PostgreSQL 9.4 disapproves    default:    case PROTOCOLUNSUPPORTED:    ERROR("Unsupported authenticationmethod %c\n",authtype);    break;    }    break;    }    case 'K':    msglen-=4+4;backendpid=cr->read_int32();
pike.git/lib/modules/Sql.pmod/pgsql.pike:1876: Inside #if defined(PG_STATS)
  #ifdef PG_STATS    portalsopened++;   #endif    clearmessage=1;    if(forcetext) { // FIXME What happens if portals are still open?    portal._unnamedportalkey=_unnamedportalmux->lock(1);    portal._portalname="";    portal->_openportal();    _readyforquerycount++;    Thread.MutexKey lock=unnamedstatement->lock(1); -  c->start(1)->add_int8('Q')->add_hstring(q,4,4+1)->add_int8(0) +  c->start(1)->add_int8('Q')->add_hstring(({q,0}),4,4)    ->sendcmd(FLUSHLOGSEND,portal);    lock=0;    PD("Simple query: %O\n",q);    } else {    object plugbuffer;    if(!sizeof(preparedname) || !tp || !tp.preparedname) {    if(!sizeof(preparedname))    preparedname=    (portal._unnamedstatementkey=    (syncparse?unnamedstatement->lock:unnamedstatement->trylock)(1))