Fixed IN and NOT IN when searching on strings

This commit is contained in:
Sébastien Drouyer 2012-10-27 20:00:40 +02:00
parent 799fe31b10
commit f17716272c
1 changed files with 5 additions and 0 deletions

View File

@ -157,6 +157,11 @@ MySQL.prototype.toDatabase = function (prop, val) {
this.toDatabase(prop, val[1]);
} else if (operator == 'inq' || operator == 'nin') {
if (!(val.propertyIsEnumerable('length')) && typeof val === 'object' && typeof val.length === 'number') { //if value is array
for (var i = 0; i < val.length; i++) {
if (typeof val[i] === 'string') {
val[i] = this.client.escape(val[i]);
}
}
return val.join(',');
} else {
return val;