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

version» Context lines:

pike.git/lib/modules/Sql.pmod/sql_util.pmod:42:    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 (objectp (m) && m->is_val_null) +  // Note: Could need bug compatibility here - in some cases +  // we might be passed a null object that can be cast to +  // "", and before this it would be. This is an observed +  // compat issue in comment #7 in [bug 5900]. +  return "NULL";    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);