Branch: Tag:

2015-12-09

2015-12-09 00:54:17 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Account for serverside closed connections.

320:    PD("Closetrace %O\n",backtrace());   #endif    if(c) { -  .pgsql_util.conxion plugbuffer=c->start(1); +  .pgsql_util.conxion plugbuffer; +  if(!catch(plugbuffer=c->start(1))) {    foreach(qportals->peek_array();;int|.pgsql_util.sql_result portal)    if(objectp(portal))    portal->_closeportal(plugbuffer);    plugbuffer->sendcmd(SENDOUT);    }    } -  + }      //! Changes the connection charset. When set to @expr{"UTF8"@}, the query,   //! parameters and results can be Pike-native wide strings.
1843:    if(!forcetext && forcecache==1    || forcecache!=0    && (sizeof(q)>=MINPREPARELENGTH || .pgsql_util.cachealways[q])) { -  object plugbuffer=c->start(); +  object plugbuffer; +  while(catch(plugbuffer=c->start())) +  reconnect();    if(tp=_prepareds[q]) {    if(tp.preparedname) {   #ifdef PG_STATS