diff --git a/lib/index.js b/lib/index.js index 8b3288b..b840b13 100644 --- a/lib/index.js +++ b/lib/index.js @@ -910,7 +910,7 @@ Statement.prototype.drop = function(callback) { Statement.prototype.execute = function(transaction, params, callback){ if (params instanceof Function) { callback = params; - params = null; + params = undefined; } this.connection.executeStatement(transaction, this, params, callback); }; @@ -1069,6 +1069,11 @@ Database.prototype.newStatement = function (query, callback) { }; Database.prototype.execute = function(query, params, callback) { + if (params instanceof Function) { + callback = params; + params = undefined; + } + this.connection.startTransaction( function(err, transaction) { if (err) {doError(err, callback); return}