Skip to content

Commit

Permalink
Fixed ignored connection errors for mysql alpha 2.0 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejpolis committed Jul 18, 2013
1 parent ce018cb commit 24cb276
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/drivers/mysql.js
Expand Up @@ -96,16 +96,19 @@ var MySqlDriver = Driver.extend({
var db; var db;
if (typeof(mysql.createConnection) === 'undefined') { if (typeof(mysql.createConnection) === 'undefined') {
db = new mysql.createClient(opts); db = new mysql.createClient(opts);
conn = new MySqlConnection(this, db, true, opts);
callback(null, conn);
} else { } else {
db = new mysql.createConnection(opts); db = new mysql.createConnection(opts);
db.connect(function(err) { db.connect(function(err) {
if (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 24cb276

Please sign in to comment.