-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
feat(query): add static parser #3365
base: master
Are you sure you want to change the base?
feat(query): add static parser #3365
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3365 +/- ##
==========================================
- Coverage 88.45% 87.68% -0.77%
==========================================
Files 83 84 +1
Lines 13067 13205 +138
Branches 1393 1396 +3
==========================================
+ Hits 11558 11579 +21
- Misses 1509 1626 +117
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks, @thomasgauvin! And sorry, january was a hectic month and I didn't really pay attention to your comment in #2289 (comment). I'll add the label Perhaps a simple approach with parameterized tests can make things easier to avoid duplicate tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomasgauvin, I added some security points that were resolved after PR #2099 was created.
If it's not a problem, can I commit directly to your branch (including the typeCast / nestTables
question and to add the tests I mentioned yesterday)?
} | ||
if (options.rowsAsArray) { | ||
result.push(value); | ||
} else if (options.nestTables) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the dynamic object properties, I believe it's beneficial to bring #2702 changes here.
There is a PoC from Snyk (Prototype Pollution): https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6861580.
Also, in #2289 it was decided to use |
Yes, please feel free to commit anything to the branch directly. I've added you as collaborator on the fork so you should have commit access. |
Missed that, will adjust |
Co-authored-by: Weslley Araújo <[email protected]>
Co-authored-by: Weslley Araújo <[email protected]>
🔬 Testing UpdatesNote I'll be updating this comment as I progress. Feel free to help with the debugging process.
node-mysql2/test/esm/integration/parsers/json-string.test.mjs Lines 18 to 20 in f2cc820
|
@sidorares, as the @thomasgauvin, I won't be committing until Saturday. Feel free to continue or wait 🙋🏻♂️
|
I'm hoping to help push for getting the interpreting parser available (this makes it possible to use mysql2 as an alternative to mysql on Cloudflare Workers).
I opened this as a new PR because I have some bandwidth to address further comments in the PR if they come up. This code merely applies the recommended fixes as noted by @shiyuhang0 to the original PR by @sidorares #2099 (the original commit history is maintained and the branch was rebased onto master).
This could also be created as a PR to
deoptimise-large-rows
branch, however the maintainers recommend moving forward.