Branch: Tag:

2014-11-09

2014-11-09 22:05:09 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Make statusfunctions wait until the connection has been established.

The driver has survived moderate testing in production servers (Roxen),
it is ready for production release.

344:   //! @[set_charset()], @[getruntimeparameters()],   //! @url{http://www.postgresql.org/search/?u=%2Fdocs%2Fcurrent%2F&q=character+sets@}   string get_charset() { +  waitauthready();    return _runtimeparameter[CLIENT_ENCODING];   }   
387:   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   mapping(string:string) getruntimeparameters() { +  waitauthready();    return _runtimeparameter+([]);   }   
576:    portal._tprepared = UNDEFINED;   }    + protected void waitauthready() { +  if(waitforauthready) { +  Thread.MutexKey lock=waitforauth->lock(); +  catch(waitforauthready->wait(lock)); +  lock=0; +  } + } +    final void _processloop(object ci) {    int terminating=0;    int|.pgsql_util.pgsql_result portal;
1468:   //! @seealso   //! @[big_query()], @[quotebinary()], @[create()]   string quote(string s) { +  waitauthready();    string r=_runtimeparameter.standard_conforming_strings;    if(r && r=="on")    return replace(s, "'", "''");
1526:   //! @seealso   //! @[host_info()]   string server_info () { +  waitauthready();    return DRIVERNAME"/"+(_runtimeparameter.server_version||"unknown");   }   
1787:    string preparedname="";    int forcecache=-1;    int forcetext=options.text_query; +  if(waitforauthready) +  waitauthready();    string cenc=_runtimeparameter[CLIENT_ENCODING];    switch(cenc) {    case UTF8CHARSET:
1846:    if(has_value(q,"\0"))    ERROR("Querystring %O contains invalid literal nul-characters\n",q);    mapping(string:mixed) tp; -  if(waitforauthready) { -  Thread.MutexKey lock=waitforauth->lock(); -  catch(waitforauthready->wait(lock)); -  lock=0; -  } +     int tstart;    if(!forcetext && forcecache==1    || forcecache!=0