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

version» Context lines:

pike.git/lib/modules/Sql.pmod/sql_util.pmod:1:   /* -  * $Id: sql_util.pmod,v 1.23 2008/06/30 12:09:15 srb Exp $ +  * $Id: sql_util.pmod,v 1.24 2008/06/30 12:10:32 srb Exp $    *    * Some SQL utility functions.    * They are kept here to avoid circular references.    *    * Henrik Grubbström 1999-07-01    */      #pike __REAL_VERSION__      //! Some SQL utility functions
pike.git/lib/modules/Sql.pmod/sql_util.pmod:44:    void|object driver)   {    array(string)k, v;    if (!bindings)    return query;    function my_quote=(driver&&driver->quote?driver->quote:quote);    v=map(values(bindings),    lambda(mixed m) {    if(zero_type(m))    return "NULL"; -  if(multisetp(m)) m = indices(m)[0]; +  if(multisetp(m)) +  return sizeof(m) ? indices(m)[0] : "";    return "'"+(intp(m)?(string)m:my_quote((string)m))+"'";    });    // Throws if mapping key is empty string.    k=map(indices(bindings),lambda(string s){    return ( (stringp(s)&&s[0]==':') ?    s : ":"+s);    });    return replace(query,k,v);   }