1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

In SQLITE_ENABLE_BATCH_ATOMIC_WRITE builds on F2FS file-systems, invoke

SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE if an SQLITE_FCNTL_COMMIT_ATOMIC_WRITE call
fails. Also, do not use an atomic transaction to create the initial database.
This is because if an error occurs while writing to the db file, any changes
to the file-size do not seem to be rolled back automatically. The only time
this matters is when the file was 0 bytes in size to start with.

FossilOrigin-Name: b3122db1545aeb48b7c28d480534b4b0fe04e83d5336225714c3cad926e5960e
This commit is contained in:
dan
2018-01-23 14:01:51 +00:00
parent 8d7f163015
commit b8fff29c68
7 changed files with 99 additions and 79 deletions

View File

@ -1203,12 +1203,14 @@ do_faultsim_test pagerfault-26 -prep {
set contents [db eval {SELECT * FROM t1}]
if {$contents != "1 2"} { error "Bad database contents ($contents)" }
set sz [file size test.db]
if {$testrc!=0 && $sz!=1024*3 && $sz!=4096*3} {
error "Expected file size to be 3072 or 12288 bytes - actual size $sz bytes"
}
if {$testrc==0 && $sz!=4096*3} {
error "Expected file size to be 12288 bytes - actual size $sz bytes"
if {[atomic_batch_write test.db]==0} {
set sz [file size test.db]
if {$testrc!=0 && $sz!=1024*3 && $sz!=4096*3} {
error "Expected file size 3072 or 12288 bytes - actual size $sz bytes"
}
if {$testrc==0 && $sz!=4096*3} {
error "Expected file size to be 12288 bytes - actual size $sz bytes"
}
}
}