Skip to content
Commit 6ab557bd authored by Yongil Jang's avatar Yongil Jang Committed by git-lg-database.lge.com
Browse files

Fix bugs of database corruption following IO error on systems supporting atomic-write

SQLite on Android uses AUTO_VACUUM option.
When the disk space is critically low and atomic-write option is enabled,
SQLite writes transactions that modify a single database page on disk
without creating a journal file.

Due to a bug, if an IO or disk full error occurs while transferring
the contents to disk, the single page that was modified in the cache
is not being rolled back - cache corruption.
As a result, applications get a database corruption exception
for next database transactions.

This patch changes createFile() to close pReal in case of IO error.
Therefore, cache is being rolled back.

This patch is originated from www.sqlite.org.
(URL: http://www.sqlite.org/src/tktview?name=df678d738a)

Change-Id: Ieecda65d8458cb591bd4d89d8b423a4479f50ea8
parent 1eb051da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment