pike.git/lib/modules/Sql.pmod/pgsql.pike:62:
#define ERROR(X ...) predef::error(X)
inherit __builtin.Sql.Connection;
final int _fetchlimit=FETCHLIMIT;
final Thread.Mutex _unnamedportalmux;
private Thread.Mutex unnamedstatement;
private Thread.MutexKey termlock;
final int _portalsinflight;
+ final int _statementsinflight;
final int _wasparallelisable;
private .pgsql_util.conxion c;
private string cancelsecret;
private int backendpid, backendstatus;
final mapping(string:mixed) _options;
private array(string) lastmessage=({});
private int clearmessage;
private mapping(string:array(mixed)) notifylist=([]);
final mapping(string:string) _runtimeparameter;
pike.git/lib/modules/Sql.pmod/pgsql.pike:451: Inside #if defined(PG_STATS)
"prepared_statement_count":pstmtcount,
#ifdef PG_STATS
"used_prepared_statements":prepstmtused,
"skipped_describe_count":skippeddescribe,
"portals_opened_count":portalsopened,
#endif
"messages_received":_msgsreceived,
"bytes_received":_bytesreceived,
"reconnect_count":reconnected,
"portals_in_flight":_portalsinflight,
+ "statements_in_flight":_statementsinflight,
]);
return stats;
}
//! @param newdepth
//! Sets the new cachedepth for automatic caching of prepared statements.
//!
//! @returns
//! The previous cachedepth.
//!
pike.git/lib/modules/Sql.pmod/pgsql.pike:1023: Inside #if defined(PG_DEBUG)
#ifdef PG_DEBUG
if(msglen<0)
errtype=PROTOCOLERROR;
#endif
portal->_processdataready(({cr->read(msglen)}),msglen);
#ifdef PG_DEBUG
msglen=0;
#endif
break;
case 'G':
+ portal->_releasestatement();
portal->_setrowdesc(@getcols());
PD("%O CopyInResponse\n",portal._portalname);
portal._state=COPYINPROGRESS;
break;
case 'c':
#ifdef PG_DEBUG
PD("%O CopyDone\n",portal._portalname);
msglen-=4;
#endif
portal=0;
pike.git/lib/modules/Sql.pmod/pgsql.pike:1299:
_readyforquerycount=1;
_waittocommit=0;
qportals->write(1);
if(!(c=getsocket()))
ERROR("Couldn't connect to database on %s:%d\n",_host,_port);
_runtimeparameter=([]);
_unnamedportalmux=Thread.Mutex();
unnamedstatement=Thread.Mutex();
readyforquery_cb=recon?reconnect_cb:connect_cb;
_portalsinflight=0;
+ _statementsinflight = 0;
_wasparallelisable = 0;
return 1;
}
//! For PostgreSQL this function performs the same function as @[resync()].
//!
//! @seealso
//! @[resync()], @[cancelquery()]
/*semi*/final void reload() {
resync();
pike.git/lib/modules/Sql.pmod/pgsql.pike:1359:
//! @seealso
//! @[cancelquery()], @[reload()]
//!
//! @note
//! This function is PostgreSQL-specific, and thus it is not available
//! through the generic SQL-interface.
/*semi*/final void resync() {
mixed err;
if(is_open()) {
err = catch {
- PD("Portalsinflight: %d\n",_portalsinflight);
+ PD("Statementsinflight: %d Portalsinflight: %d\n",
+ _statementsinflight, _portalsinflight);
if(!waitforauthready) {
readyforquery_cb=resync_cb;
sendsync();
}
return;
};
PD("%O\n",err);
}
if(!reconnect()&&sizeof(lastmessage))
ERROR(a2nls(lastmessage));