From f316b8ca7dcdc4c9b0d2823e0efc55381dfe0161 Mon Sep 17 00:00:00 2001 From: ulion Date: Sun, 8 Mar 2015 22:52:38 +0800 Subject: [PATCH] Fix mysql neq for NULL value. --- lib/mysql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mysql.js b/lib/mysql.js index 135e448..6b641e2 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -499,7 +499,7 @@ MySQL.prototype._buildWhere = function (model, conds) { sqlCond += ' NOT IN '; break; case 'neq': - sqlCond += ' != '; + sqlCond += val === 'NULL' ? ' IS NOT ' : ' != '; break; case 'like': sqlCond += ' LIKE ';