不要怂,就是干,撸起袖子干!

Commit fbb536d8 by Elliot Foster

Stop setting global variable 'columnTypes' on error

1 parent 146f9270
Showing with 7 additions and 2 deletions
...@@ -35,8 +35,13 @@ module.exports = (function() { ...@@ -35,8 +35,13 @@ module.exports = (function() {
self.database[getDatabaseMethod.call(self)](self.sql, function(err, results) { self.database[getDatabaseMethod.call(self)](self.sql, function(err, results) {
// allow clients to listen to sql to do their own logging or whatnot // allow clients to listen to sql to do their own logging or whatnot
self.emit('sql', self.sql) self.emit('sql', self.sql)
this.columnTypes = columnTypes;
err ? onFailure.call(self, err) : onSuccess.call(self, results, this) if (err) {
onFailure.call(self, err)
} else {
this.columnTypes = columnTypes
onSuccess.call(self, results, this)
}
}) })
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!