pike.git
/
lib
/
modules
/
Sql.pmod
/
sql_util.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/sql_util.pmod:84:
array(mixed) args=allocate(sizeof(extraargs)); if (!bindings) bindings = ([]); int a, new_bindings; foreach(extraargs; int j; mixed s) { if (stringp(s) || multisetp(s)) { string bind_name; do { bind_name = ":arg"+(a++);
-
} while (
!zero
_
type
(bindings
[
bind_name
]
));
+
} while (
has
_
index
(bindings
,
bind_name));
args[j]=bind_name; bindings[bind_name] = s; new_bindings = 1; continue; } if (intp(s) || floatp(s)) { args[j] = s || zero; continue; } if (objectp (s) && s->is_val_null) {
pike.git/lib/modules/Sql.pmod/sql_util.pmod:127:
//! variables' names. string emulate_bindings(string query, mapping(string|int:mixed)|void bindings, 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))
+
if(
undefinedp
(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))+"'";