Skip to content

Commit

Permalink
Merge pull request #689 from swftvsn/patch-2
Browse files Browse the repository at this point in the history
Wrap executePacket.toPacket(1) call with try/catch
  • Loading branch information
sidorares authored Jan 31, 2018
2 parents 1ff8890 + 9d46fbb commit b6175d8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/commands/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ Execute.prototype.start = function(packet, connection) {
this.parameters,
connection.config.charsetNumber
);
connection.writePacket(executePacket.toPacket(1));
//For reasons why this try-catch is here, please see
// https://github.com/sidorares/node-mysql2/pull/689
//For additional discussion, see
// 1. https://github.com/sidorares/node-mysql2/issues/493
// 2. https://github.com/sidorares/node-mysql2/issues/187
// 3. https://github.com/sidorares/node-mysql2/issues/480
try {
connection.writePacket(executePacket.toPacket(1));
} catch (error) {
this.onResult(error)
}
return Execute.prototype.resultsetHeader;
};

Expand Down

0 comments on commit b6175d8

Please sign in to comment.