Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: mysql2 query argument order compatibility #381

Merged

Conversation

bryanvaz
Copy link
Contributor

Issue #: #380

Description of changes:

Fixes issue with mysql2 driver where x-ray monkey patch forconnection.query and connection.execute incorrectly parsed arguments. Specificlly mysql2 argument order is:

  • 1st argument is of type Object;
  • 2nd argument is an array of values for binding to sql query; and
  • 3rd argument is callback.

Unit tests added:

  1. Tests if arguments are correctly parsed and sent to base mysql2 query driver

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Fixes issue with mysql2 query where 1st argument is of type Object, 2nd argument is an array of values for binding to sql query, and 3rd argument is callback.

fixes aws#380
Copy link
Contributor

@willarmiros willarmiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, will be compatible with existing MySQL behavior and add better support for MySQL2. Thanks!

@willarmiros willarmiros merged commit 072c0a9 into aws:master Feb 25, 2021
@bryanvaz
Copy link
Contributor Author

Should also fix sidorares/node-mysql2#1010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants