Branch: Tag:

2001-01-09

2001-01-09 21:18:30 by Marcus Comstedt <marcus@mc.pp.se>

Changed syntax of emulated bindings to match non-emulated bindings.

Rev: lib/modules/Sql.pmod/Sql.pike:1.46
Rev: lib/modules/Sql.pmod/sql.pike:1.46(DEAD)
Rev: lib/modules/Sql.pmod/sql_util.pmod:1.7

1:   /* -  * $Id: sql_util.pmod,v 1.6 2000/09/28 03:39:10 hubbe Exp $ +  * $Id: sql_util.pmod,v 1.7 2001/01/09 21:18:30 marcus Exp $    *    * Some SQL utility functions.    * They are kept here to avoid circular references.
11:      //.   //. File: sql_util.pmod - //. RCSID: $Id: sql_util.pmod,v 1.6 2000/09/28 03:39:10 hubbe Exp $ + //. RCSID: $Id: sql_util.pmod,v 1.7 2001/01/09 21:18:30 marcus Exp $   //. Author: Henrik Grubbström (grubba@idonex.se)   //.   //. Synopsis: Some SQL utility functions
56:    if (!bindings)    return query;    v=Array.map(values(bindings), -  lambda(mixed m) {return -  my_quote(stringp(m)?m:(string)m);}); -  k=Array.map(indices(bindings),lambda(string s){return ":"+s;}); +  lambda(mixed m) { +  if(multisetp(m)) m = indices(m)[0]; +  return (stringp(m)? "'"+my_quote(m)+"'" : (string)m); +  }); +  k=Array.map(indices(bindings),lambda(string s){ +  return (stringp(s)? s : ":"+s); +  });    return replace(query,k,v);   }