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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:317:   //! through the generic SQL-interface.   void cancelquery() {    PD("CancelRequest\n");    .pgsql_util.PGassist lcon=getsocket(1);    lcon->add_int32(16)->add_int32(PG_PROTOCOL(1234,5678))    ->add_int32(backendpid)->add(cancelsecret)->sendcmd(flushsend);    lcon->close();   #ifdef PG_DEBUGMORE    PD("Closetrace %O\n",backtrace());   #endif +  if(c) {    .pgsql_util.PGassist plugbuffer=c->start(1);    foreach(qportals->peek_array();;int|.pgsql_util.pgsql_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.   //!   //! @param charset   //! A PostgreSQL charset name.   //!   //! @seealso   //! @[get_charset()], @[create()],   //! @url{http://www.postgresql.org/search/?u=%2Fdocs%2Fcurrent%2F&q=character+sets@}
pike.git/lib/modules/Sql.pmod/pgsql.pike:579:      private void storetiming(.pgsql_util.pgsql_result portal) {    mapping(string:mixed) tp=portal._tprepared;    tp.trun=gethrtime()-tp.trunstart;    m_delete(tp,"trunstart");    portal._tprepared = UNDEFINED;   }      private void waitauthready() {    if(waitforauthready) { +  PD("Wait for auth ready %O\n",backtrace()[-2]);    Thread.MutexKey lock=waitforauth->lock();    catch(waitforauthready->wait(lock));    lock=0; -  +  PD("Wait for auth ready released.\n");    }   }      private inline mixed callout(function(mixed ...:void) f,    float|int delay,mixed ... args) {    return .pgsql_util.local_backend->call_out(f,delay,@args);   }      final void _processloop(.pgsql_util.PGassist ci) {    int terminating=0;
pike.git/lib/modules/Sql.pmod/pgsql.pike:1107:    mapping(string:string) msgresponse;    msgresponse=getresponse();    warningsdropcount+=warningscollected;    warningscollected=0;    switch(msgresponse.C) {    case "P0001":    lastmessage=({sprintf("%s: %s",msgresponse.S,msgresponse.M)});    USERERROR(a2nls(lastmessage    +({pinpointerror(portal._query,msgresponse.P)})    +showbindings(portal))); +  case "53000":case "53100":case "53200":case "53300":case "53400":    case "57P01":case "57P02":case "57P03":    preplastmessage(msgresponse);    PD(a2nls(lastmessage));throw(0);    case "08P01":case "42P05":    errtype=protocolerror;    case "XX000":case "42883":case "42P01":    invalidatecache=1;    default:    preplastmessage(msgresponse);    if(msgresponse.D)
pike.git/lib/modules/Sql.pmod/pgsql.pike:1233:    if(!or._delayederror)    or._delayederror=err;    if(objectp(portal))    portal->_releasesession();    portal=0;    if(!waitforauthready)    continue; // Only continue if authentication did not fail    }    break;    } +  PD("Closing database processloop %O\n",err);    _delayederror=err; -  +  for(;objectp(portal);portal=qportals->read()) +  if(objectp(portal)) { + #ifdef PG_DEBUG +  showportal(0); + #endif +  portal->_purgeportal(); +  }    if(!ci->close() && !terminating && _options.reconnect)    _connectfail();    else if(waitforauthready)    destruct(waitforauthready);    if(err && !stringp(err))    throw(err);   }      //! Closes the connection to the database, any running queries are   //! terminated instantly.