From f17716272c8aaf56cb5e397a363f0147ffb54300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Drouyer?= Date: Sat, 27 Oct 2012 20:00:40 +0200 Subject: [PATCH] Fixed IN and NOT IN when searching on strings --- lib/adapters/mysql.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/adapters/mysql.js b/lib/adapters/mysql.js index 2fd19a06..eb1155e3 100644 --- a/lib/adapters/mysql.js +++ b/lib/adapters/mysql.js @@ -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;