diff --git a/promise.js b/promise.js index fc74cc0c3a..1b8d940d58 100644 --- a/promise.js +++ b/promise.js @@ -124,6 +124,13 @@ class PromiseConnection extends EventEmitter { }); } + taggedExecute() { + return (strings, ...keys) => { + const statementQuery = strings.join('?'); + return this.execute(statementQuery, keys).then(result => result[0]) + } + } + end() { return new this.Promise(resolve => { this.connection.end(resolve); @@ -372,6 +379,13 @@ class PromisePool extends EventEmitter { }); } + taggedExecute() { + return (strings, ...keys) => { + const statementQuery = strings.join('?'); + return this.execute(statementQuery, keys).then(result => result[0]); + } + } + end() { const corePool = this.pool; const localErr = new Error(); diff --git a/test/integration/connection/test-connect-after-connection-error.js b/test/integration/connection/test-connect-after-connection-error.js index 0eb19c5c54..001a33fbc8 100644 --- a/test/integration/connection/test-connect-after-connection-error.js +++ b/test/integration/connection/test-connect-after-connection-error.js @@ -11,7 +11,6 @@ portfinder.getPort((err, port) => { let serverConnection; server.listen(port); server.on('connection', conn => { - console.log('Here!'); conn.serverHandshake({ serverVersion: '5.6.10', capabilityFlags: 2181036031 diff --git a/test/integration/connection/test-connect-connection-closed-error.js b/test/integration/connection/test-connect-connection-closed-error.js index f6efc3bd6a..84e7749db2 100644 --- a/test/integration/connection/test-connect-connection-closed-error.js +++ b/test/integration/connection/test-connect-connection-closed-error.js @@ -11,7 +11,6 @@ portfinder.getPort((err, port) => { const server = mysql.createServer(); server.listen(port); server.on('connection', conn => { - console.log('Here!'); conn.close(); }); diff --git a/test/integration/connection/test-connect-time-error.js b/test/integration/connection/test-connect-time-error.js index 48fe86dcc5..ed3e64ef4b 100644 --- a/test/integration/connection/test-connect-time-error.js +++ b/test/integration/connection/test-connect-time-error.js @@ -10,7 +10,6 @@ portfinder.getPort((err, port) => { const server = mysql.createServer(); server.listen(port); server.on('connection', conn => { - console.log('Here!'); conn.writeError(new Error(ERROR_TEXT)); conn.close(); }); diff --git a/test/integration/connection/test-execute-bind-date.js b/test/integration/connection/test-execute-bind-date.js index d98e58ce5b..525a4b3290 100644 --- a/test/integration/connection/test-execute-bind-date.js +++ b/test/integration/connection/test-execute-bind-date.js @@ -7,7 +7,7 @@ const assert = require('assert'); const date = new Date(2018, 2, 10, 15, 12, 34, 1234); let rows; -connection.execute('SELECT ? AS result', [date], (err, _rows) => { +connection.execute('SELECT CAST(? AS DATETIME(6)) AS result', [date], (err, _rows) => { if (err) { throw err; }