pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql.pike:28:
int _fetchlimit=FETCHLIMIT; private int unnamedportalinuse; private int portalsinflight; object _c; private string SSauthdata,cancelsecret; private int backendpid; private int backendstatus; private mapping(string:mixed) options; private string lastmessage;
+
private int clearmessage;
private mapping(string:array(mixed)) notifylist=([]); private mapping(string:string) msgresponse; private mapping(string:string) runtimeparameter; state _mstate; private enum querystate {queryidle,inquery,cancelpending,canceled}; private querystate qstate; private mapping(string:mapping(string:mixed)) prepareds=([]); private int pstmtcount; private int pportalcount; private int totalhits;
pike.git/lib/modules/Sql.pmod/pgsql.pike:602:
pinpointerror(msgresponse->q,msgresponse->p), addnlifpresent(msgresponse->W)); switch(msgresponse->S) { case "PANIC":werror(lastmessage); } USERERROR(lastmessage); } break; case 'N':PD("NoticeResponse\n"); getresponse();
-
lastmessage=sprintf("%s %s: %s",
+
if(clearmessage)
+
clearmessage=0,
lastmessage=
UNDEFINED;
+
lastmessage=
sprintf("%s
%s
%s: %s",
+
lastmessage?lastmessage+"\n":"",
msgresponse->S,msgresponse->C,msgresponse->M); break; case 'A':PD("NotificationResponse\n"); { msglen-=4+4; int pid=_c.getint32(); string condition,extrainfo=UNDEFINED; { array(string) ts=getstrings(); switch(sizeof(ts)) { case 0:errtype=protocolerror; break;
pike.git/lib/modules/Sql.pmod/pgsql.pike:1171:
tstart=gethrtime(); } // pgsql_result autoassigns to portal .pgsql_util.pgsql_result(this,tprepared,q,_fetchlimit,portalbuffersize); if(unnamedportalinuse) portalname=PORTALPREFIX+(string)pportalcount++; else unnamedportalinuse++; _c.portal->_portalname=portalname; qstate=inquery; portalsinflight++;
+
clearmessage=1;
mixed err; if(err = catch { if(!sizeof(preparedname) || !tprepared || !tprepared->preparedname) { PD("Parse statement %s\n",preparedname); // Even though the protocol doesn't require the Parse command to be // followed by a flush, it makes a VERY noticeable difference in // performance if it is omitted; seems like a flaw in the PostgreSQL // server _c.sendcmd(({"P",_c.plugint32(4+sizeof(preparedname)+1+sizeof(q)+1+2), preparedname,"\0",q,"\0",_c.plugint16(0)}),1);