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: deep copy strings during scan #499

Merged
merged 1 commit into from
Jun 18, 2023
Merged

fix: deep copy strings during scan #499

merged 1 commit into from
Jun 18, 2023

Conversation

asdine
Copy link
Collaborator

@asdine asdine commented Jun 18, 2023

When decoding a document from the disk, fields of type TEXT are not copied on purpose to avoid doing unnecessary copies.
However, when the data reaches the upper layers, usually when it's about to get scanned (i.e. document.Scan, document.StructScan), strings must always get deep cloned before being returned to the user.

Fixes #497

@asdine asdine added the bug Something isn't working label Jun 18, 2023
@codecov
Copy link

codecov bot commented Jun 18, 2023

Codecov Report

Merging #499 (a558b23) into main (5397cbc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head a558b23 differs from pull request most recent head 9d1940d. Consider uploading reports for the commit 9d1940d to get more accurate results

@@           Coverage Diff           @@
##             main     #499   +/-   ##
=======================================
  Coverage   78.81%   78.81%           
=======================================
  Files         129      129           
  Lines       10947    10948    +1     
=======================================
+ Hits         8628     8629    +1     
  Misses       1599     1599           
  Partials      720      720           
Impacted Files Coverage Δ
document/scan.go 59.62% <100.00%> (+0.15%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scanning results inside iteration (Result.Iterate, document.ScanIterator) is completely broken
1 participant