Skip to content

Commit

Permalink
Merge pull request #80 from andrzejpolis/master
Browse files Browse the repository at this point in the history
Fixed ignored connection errors for mysql alpha 2.0 driver
  • Loading branch information
joeferner committed Jul 18, 2013
2 parents ce018cb + 9dbb59a commit c6bdce1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/drivers/mysql.js
Expand Up @@ -96,16 +96,20 @@ var MySqlDriver = Driver.extend({
var db;
if (typeof(mysql.createConnection) === 'undefined') {
db = new mysql.createClient(opts);
conn = new MySqlConnection(this, db, true, opts);
callback(null, conn);
} else {
db = new mysql.createConnection(opts);
var _this = this;
db.connect(function(err) {
if (err) {
console.log(err);
callback(err);
} else {
conn = new MySqlConnection(_this, db, true, opts);
callback(null, conn);
}
});
}
conn = new MySqlConnection(this, db, true, opts);
callback(null, conn);
}
},

Expand Down

0 comments on commit c6bdce1

Please sign in to comment.