Permalink
Browse files

Fixed error with backwards compatability of mysql driver

  • Loading branch information...
1 parent 780f427 commit 84171c2a6ef3a31f1e0f445d1b6344b2155b713f Tyler Vernon committed Aug 7, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/driver/mysql.js
View
@@ -107,10 +107,10 @@ var MysqlDriver = Base.extend({
exports.connect = function(config, callback) {
var db;
- if(typeof(mysql.createConnection != 'undefined')){
- db = new mysql.createConnection(config);
+ if(typeof(mysql.createConnection === 'undefined')){
+ db = config.db || new mysql.createClient(config);
}else{
- db = new mysql.createClient(config);
+ db = config.db || new mysql.createConnection(config);
}
callback(null, new MysqlDriver(db));
};

0 comments on commit 84171c2

Please sign in to comment.