Skip to content
Snippets Groups Projects
Commit 39adc63f authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

Multisets produce one element unquoted

Rev: lib/modules/Sql.pmod/sql_util.pmod:1.24
parent a9b54ece
Branches
Tags
No related merge requests found
/* /*
* $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. * Some SQL utility functions.
* They are kept here to avoid circular references. * They are kept here to avoid circular references.
...@@ -51,7 +51,8 @@ string emulate_bindings(string query, mapping(string|int:mixed)|void bindings, ...@@ -51,7 +51,8 @@ string emulate_bindings(string query, mapping(string|int:mixed)|void bindings,
lambda(mixed m) { lambda(mixed m) {
if(zero_type(m)) if(zero_type(m))
return "NULL"; 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))+"'"; return "'"+(intp(m)?(string)m:my_quote((string)m))+"'";
}); });
// Throws if mapping key is empty string. // Throws if mapping key is empty string.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment