Fixed IN and NOT IN when searching on strings
This commit is contained in:
parent
799fe31b10
commit
f17716272c
|
@ -157,6 +157,11 @@ MySQL.prototype.toDatabase = function (prop, val) {
|
||||||
this.toDatabase(prop, val[1]);
|
this.toDatabase(prop, val[1]);
|
||||||
} else if (operator == 'inq' || operator == 'nin') {
|
} else if (operator == 'inq' || operator == 'nin') {
|
||||||
if (!(val.propertyIsEnumerable('length')) && typeof val === 'object' && typeof val.length === 'number') { //if value is array
|
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(',');
|
return val.join(',');
|
||||||
} else {
|
} else {
|
||||||
return val;
|
return val;
|
||||||
|
|
Loading…
Reference in New Issue