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

don't try deserializing short blobs #249

Merged
merged 2 commits into from
Oct 20, 2021
Merged

don't try deserializing short blobs #249

merged 2 commits into from
Oct 20, 2021

Conversation

aplavin
Copy link
Contributor

@aplavin aplavin commented Jul 31, 2021

fixes #248

@codecov
Copy link

codecov bot commented Aug 1, 2021

Codecov Report

Merging #249 (a8a75d7) into master (b4d80a9) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
- Coverage   83.19%   83.16%   -0.03%     
==========================================
  Files           5        5              
  Lines         607      606       -1     
==========================================
- Hits          505      504       -1     
  Misses        102      102              
Impacted Files Coverage Δ
src/SQLite.jl 96.23% <100.00%> (+0.01%) ⬆️
src/consts.jl 85.71% <0.00%> (-3.18%) ⬇️

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 b4d80a9...f5e29ec. Read the comment docs.

test/runtests.jl Outdated Show resolved Hide resolved
Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

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

This LGTM; I think there was also an open issue about not deserializing non-serialized blobs. Because I think it's still an issue if you just serialize some random bytes as a blob and it's longer than sizeof(SERIALIZATION). But we can fix that later if you want. Thanks for this! If you wouldn't mind tweaking the test to fix the only issue, we can merge after that.

@quinnj
Copy link
Member

quinnj commented Aug 1, 2021

Actually, I'm just going to bump the Julia compat for the package up to 1.3, so that should solve the only problem. I'll rerun CI on this PR.

@quinnj quinnj closed this Aug 1, 2021
@quinnj quinnj reopened this Aug 1, 2021
@aplavin
Copy link
Contributor Author

aplavin commented Aug 1, 2021

only isn't needed here, changed to first in both PRs.

@aplavin
Copy link
Contributor Author

aplavin commented Aug 1, 2021

Because I think it's still an issue if you just serialize some random bytes as a blob and it's longer than sizeof(SERIALIZATION).

What exactly do you mean here? Like, if starting bytes of a blob coincide with those of SERIALIZATION by chance?

I would really like to have a way to completely opt-out of serialization/deserialization in SQLite.jl (or even make it opt-in). It's arguably pretty rare to have an sqlite database that is to be accessed from julia alone, and even more so - from an exactly matching version of julia with the same package versions. Serialization docs say:

In general, this process will not work if the reading and writing are done by different versions of Julia, or an instance of Julia with a different system image.

I was surprised by this behavior when unexpectedly ended up with serialized blobs in my database that resulted from Symbols. Loose sqlite "typing" doesn't help here at all.

An error would be a much safer approach.

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

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

Thanks @aplavin!

@quinnj quinnj merged commit 42c9c3d into JuliaDatabases:master Oct 20, 2021
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.

Cannot read empty blob
2 participants