From 7344088cc6b57082b0504325c5c97e41808edb2e Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 19 Aug 2014 16:36:33 -0700 Subject: [PATCH] Fix the createDatabase option --- lib/mysql.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mysql.js b/lib/mysql.js index f72c72c..53b41a8 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -57,6 +57,9 @@ exports.initialize = function initializeDataSource(dataSource, callback) { // Take other options for mysql driver // See https://github.com/strongloop/loopback-connector-mysql/issues/46 for (var p in s) { + if (p === 'database' && s.createDatabase) { + continue; + } if (options[p] === undefined) { options[p] = s[p]; } @@ -149,7 +152,7 @@ MySQL.prototype.query = function (sql, callback) { connection.query(sql, function (err, data) { if (debugEnabled) { if (err) { - console.error('Error: ', err); + console.error('Error: %j', err); } debug('Data: ', data); } @@ -655,7 +658,7 @@ MySQL.prototype.autoupdate = function (models, cb) { function done(err) { if (err) { - console.error(err); + console.error('%j', err); } if (--wait === 0 && cb) { cb();