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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:604:    if(user)    plugbuffer->add("user\0")->add(user)->add_int8(0);    if(database)    plugbuffer->add("database\0")->add(database)->add_int8(0);    _options.reconnect=undefinedp(_options.reconnect) || _options.reconnect;    foreach(_options-.pgsql_util.censoroptions; string name; mixed value)    plugbuffer->add(name)->add_int8(0)->add((string)value)->add_int8(0);    plugbuffer->add_int8(0);    PD("%O\n",(string)plugbuffer);    if(catch(ci->start()->add_hstring(plugbuffer,4,4)->sendcmd(SENDOUT))) { -  if(_options.reconnect) + #ifdef PG_DEBUG +  if(!_options) +  PD("_options is zero, %O\n",this); + #endif +  if(_options && _options.reconnect) // FIXME why can _options be 0?    _connectfail();    else    destruct(waitforauthready);    return;    }    } // Do not flush at this point, PostgreSQL 9.4 disapproves    cancelsecret=0;   #ifdef PG_DEBUG    PD("Processloop\n");    string datarowdebug;
pike.git/lib/modules/Sql.pmod/pgsql.pike:1312:   //! session variables to their default values.   //!   //! @seealso   //! @[cancelquery()], @[reload()]   //!   //! @note   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   void resync() {    mixed err; -  if(!is_open()&&!reconnect()&&sizeof(lastmessage)) -  ERROR(a2nls(lastmessage)); +  if(is_open()) {    err = catch {    PD("Portalsinflight: %d\n",_portalsinflight);    if(!waitforauthready) {    readyforquery_cb=resync_cb;    sendsync();    }    return;    };    PD("%O\n",err); -  +  }    if(!reconnect()&&sizeof(lastmessage))    ERROR(a2nls(lastmessage));   }      //! This function allows you to connect to a database. Due to   //! restrictions of the Postgres frontend-backend protocol, you always   //! have to be connected to a database, so in fact this function just   //! allows you to connect to a different database on the same server.   //!   //! @note