Closed Bug 467856 Opened 16 years ago Closed 16 years ago

Expose SQLITE_IOERR

Categories

(Toolkit :: Storage, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9.2a1

People

(Reporter: mak, Assigned: mak)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

if an sqlite database is in use by another application opening the connection could return SQLITE_IOERR instead of SQLITE_LOCKED.

Notice this sqlite 3 doc about extended result codes
http://www.sqlite.org/c3ref/c_ioerr_access.html

and notice that:
#define SQLITE_LOCKED       6   /* A table in the database is locked */
(from http://www.sqlite.org/c3ref/c_abort.html)

so we are practically using TABLE_IS_LOCKED as FILE_IS_LOCKED error, while we should detect SQLITE_IOERR_UNLOCK, SQLITE_IOERR_RDLOCK, SQLITE_IOERR_LOCK to correctly detect if a file is locked.

if we can't make mozStorage use extended result codes, we should at least provide a generic NS_ERROR_STORAGE_IOERROR
per IRC we can't expose extended results code per compatibility issues (will be done for moz2) so for now we only expose SQLITE_IOERR
Summary: Expose SQLITE_IOERR, or extended result codes → Expose SQLITE_IOERR
Attached patch patch (obsolete) — Splinter Review
Attachment #351295 - Flags: review?(sdwilsh)
Blocks: 414715
Comment on attachment 351295 [details] [diff] [review]
patch

>+#define NS_ERROR_STORAGE_IOERR \
>+  NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_STORAGE, SQLITE_IOERR)
I had to fix bustage with this yesterday - just make this 2

r=sdwilsh
Attachment #351295 - Flags: review?(sdwilsh) → review+
asking blocking because is blocking places from detecting database status
Flags: blocking1.9.1?
blocking+.
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P1
Target Milestone: --- → mozilla1.9.1b3
Attached patch patch v1.1Splinter Review
unbitrot and fixed comment
Attachment #351295 - Attachment is obsolete: true
pushed to trunk
http://hg.mozilla.org/mozilla-central/rev/bad1a35faa15
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/61050a8edfed
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1
Target Milestone: mozilla1.9.1b3 → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: