Skip to content
Snippets Groups Projects
Commit 0e09b4db authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Handle null objects correctly in emulate_bindings.

Note that fixing this opens up a bug compat issue, described in
comment #7 in [bug 5900].
parent 5069374a
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,12 @@ string emulate_bindings(string query, mapping(string|int:mixed)|void 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))+"'";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment