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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:125:    flushed=1;    break;    default:    flushed=0;    break;    case 1:    cmdbuf+=({FLUSH});    PD("Flush\n");    case 2:    flushed=1; -  write(cmdbuf); +  { int i=write(cmdbuf); +  if(portal && portal._pgsqlsess) { +  portal._pgsqlsess._packetssent++; +  portal._pgsqlsess._bytessent+=i; +  } +  }    cmdbuf=({});    }    }       final void sendterminate() {    PD("Terminate\n");    sendcmd(({"X",plugint32(4)}),2);    close();    }   
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:219:      class pgsql_result {      object _pgsqlsess;   private int numrows;   private int eoffound;   private mixed delayederror;   private int copyinprogress;   int _fetchlimit;    - private mapping tprepared; +    #ifdef NO_LOCKING   int _qmtxkey;   #else   Thread.MutexKey _qmtxkey;   #endif      string query;   string _portalname;      int _bytesreceived;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:261:    "laststatus: %s\n",    numrows,eoffound,!!_qmtxkey,_inflight,    _portalname,sizeof(_datarowdesc),    query,    _statuscmdcomplete||"");    break;    }    return res;   }    - void create(object pgsqlsess,mapping(string:mixed) _tprepared, -  string _query,int fetchlimit,int portalbuffersize) { + void create(object pgsqlsess,string _query,int fetchlimit, +  int portalbuffersize) {    _pgsqlsess = pgsqlsess; -  tprepared = _tprepared; query = _query; +  query = _query;    _datarows = ({ }); numrows = UNDEFINED;    fetchmutex = Thread.Mutex();    _fetchlimit=fetchlimit;    _portalbuffersize=portalbuffersize;    steallock();   }      //! Returns the command-complete status for this query.   //!   //! This function is PostgreSQL-specific, and thus it is not available
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:416:    buffer,_pgsqlsess._nextportal,!!_qmtxkey);   #endif   #ifdef USEPGsql    _buffer=buffer;   #endif    switch(_pgsqlsess._decodemsg()) {    case copyinresponse:    copyinprogress=1;    return UNDEFINED;    case dataready: -  if(tprepared) { -  tprepared->trun=gethrtime()-tprepared->trunstart; -  m_delete(tprepared,"trunstart"); -  tprepared = UNDEFINED; -  } +     _pgsqlsess._mstate=dataprocessed;    _rowsreceived++;    switch(buffer) {    case 0:    case 1:    if(_fetchlimit)    _fetchlimit=    min(_portalbuffersize/2*_rowsreceived/_bytesreceived || 1,    _pgsqlsess._fetchlimit);    }