sqlite3_quota_ftruncate() likely broken

NEW
Unassigned

Status

()

Core
DOM: IndexedDB
P5
normal
6 years ago
3 months ago

People

(Reporter: janv, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
I changed GetSize() in Mozilla1/src/dom/indexedDB/FileStream.cpp to call sqlite3_quota_file_truesize() instead of sqlite3_quota_file_size()
test_truncate.html now passes w/o any problems.
So it seems sqlite3_quota_ftruncate() is buggy (the file is correctly truncated, but it corrupts internal quota structures somehow), now when I look at its body, the code doesn't make sense to me.
However, I still wonder why it fails only on android.
(Reporter)

Comment 1

6 years ago
Ben, so it seems that we hit the same bug here ...
If the limit is set to 0, then the quota group disappears at some point and sqlite_quota_file_size() returns -1

So we can call sqlite_quota_file_size() first and then call sqlite_quota_file_truesize() only if the former returned -1
Comment hidden (spam)
Comment hidden (spam)

Updated

3 months ago
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.