Skip to content

Fix maximum call stack errors when parsing query results - #1240

Merged
arthurschreiber merged 2 commits into
masterfrom
fix-stack-overflow
Mar 25, 2021
Merged

arthurschreiber merged 2 commits into
masterfrom
fix-stack-overflow

Conversation

@arthurschreiber

@arthurschreiber arthurschreiber commented Mar 17, 2021 •

Copy link
Copy Markdown
Collaborator

This reworks the COLMETADATA, ROW and NBCROW token parsing logic to parse incoming data in a fashion that does not grow the call stack in relation to the incoming packet size.

Fixes: #839
Fixes: #1206

@codecov

codecov Bot commented Mar 17, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1240 (c1bc1da) into master (f6e1681) will decrease coverage by 1.19%.
The diff coverage is 76.47%.

❗ Current head c1bc1da differs from pull request most recent head 3fd1ec9. Consider uploading reports for the commit 3fd1ec9 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1240      +/-   ##
==========================================
- Coverage   81.52%   80.32%   -1.20%     
==========================================
  Files          85       85              
  Lines        4536     4570      +34     
  Branches      846      855       +9     
==========================================
- Hits         3698     3671      -27     
- Misses        574      639      +65     
+ Partials      264      260       -4     
Impacted Files Coverage Δ
src/token/nbcrow-token-parser.ts 57.89% <55.55%> (-17.97%) ⬇️
src/token/colmetadata-token-parser.ts 76.19% <66.66%> (-10.66%) ⬇️
src/token/stream-parser.ts 73.79% <90.62%> (+1.34%) ⬆️
src/token/row-token-parser.ts 100.00% <100.00%> (ø)
src/incoming-message-stream.ts 92.68% <0.00%> (-4.88%) ⬇️
src/connection.ts 63.21% <0.00%> (-3.77%) ⬇️
src/login7-payload.ts 89.30% <0.00%> (-0.54%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6e1681...3fd1ec9. Read the comment docs.

This reworks the `COLMETADATA`, `ROW` and `NBCROW` token parsing logic to parse incoming data in a fashion that does not grow the call stack in relation to the incoming packet size.

Co-authored-by: Ian Chok <[email protected]>
@arthurschreiber
arthurschreiber merged commit 16366a5 into master Mar 25, 2021
@arthurschreiber
arthurschreiber deleted the fix-stack-overflow branch March 25, 2021 09:40
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 11.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded

1 participant