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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:1464:   //! idle   //! intransaction   //! infailedtransaction   //!   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   final string status_commit() {    return trbackendst(backendstatus);   }    - final private void closestatement(array(string) plugbuf,mapping tp) { + final private array(string) closestatement(mapping tp) {    string oldprep=tp->preparedname; -  +  array(string) ret=({});    if(oldprep) {    PD("Close statement %s\n",oldprep); -  plugbuf+=({"C",_c.plugint32(4+1+sizeof(oldprep)+1), +  ret=({"C",_c.plugint32(4+1+sizeof(oldprep)+1),    "S",oldprep,"\0"});    } -  +  return ret;   }      //! @decl Sql.pgsql_util.pgsql_result big_query(string query)   //! @decl Sql.pgsql_util.pgsql_result big_query(string query, mapping bindings)   //!   //! This is the only provided interface which allows you to query the   //! database. If you wish to use the simpler "query" function, you need to   //! use the @[Sql.Sql] generic SQL-object.   //!   //! It returns a pgsql_result object (which conforms to the
pike.git/lib/modules/Sql.pmod/pgsql.pike:1573:    && (zero_type(options->cache_autoprepared_statements)    || options->cache_autoprepared_statements))    preparedname=PREPSTMTPREFIX+(string)pstmtcount++;    }    else {    if(totalhits>=cachedepth) {    foreach(prepareds;string ind;tp) {    int oldhits=tp->hits;    totalhits-=oldhits-(tp->hits=oldhits>>1);    if(oldhits<=1) { -  closestatement(plugbuf,tp); +  plugbuf+=closestatement(tp);    m_delete(prepareds,ind);    }    }    }    if(forcecache!=1 && createprefix->match(q)) // Flush cache on CREATE    invalidatecache=1;    else    prepareds[q]=tp=([]);    }    if(invalidatecache) {    invalidatecache=0;    foreach(prepareds;;mapping np) { -  closestatement(plugbuf,np); +  plugbuf+=closestatement(np);    m_delete(np,"preparedname");    }    }    if(sizeof(plugbuf)) {    _c.sendcmd(plugbuf,1); // close expireds    PD("%O\n",plugbuf);    }    tstart=gethrtime();    } // pgsql_result autoassigns to portal    else