Use NULL for undefined

This commit is contained in:
Raymond Feng 2014-03-21 08:35:04 -07:00
parent 177207d6a5
commit 8f5b09ba64
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ function dateToMysql(val) {
*/
MySQL.prototype.toDatabase = function (prop, val) {
if (val === null) return 'NULL';
if (val === undefined) return;
if (val === undefined) return 'NULL';
if (val.constructor.name === 'Object') {
var operator = Object.keys(val)[0]
val = val[operator];