generalize escape on IN and NOT IN values
This commit is contained in:
parent
d5b0003350
commit
fc46de162f
|
@ -158,9 +158,7 @@ MySQL.prototype.toDatabase = function (prop, val) {
|
||||||
} 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++) {
|
for (var i = 0; i < val.length; i++) {
|
||||||
if (typeof val[i] === 'string') {
|
val[i] = this.client.escape(val[i]);
|
||||||
val[i] = this.client.escape(val[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return val.join(',');
|
return val.join(',');
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue