SQLite

View Ticket
Login
2009-10-19
11:43 Deferred ticket [897b96d4]: SQLITE_CANTOPEN when using journal_mode=persist and async IO plus 1 other change (artifact: 433a58d3 user: dan)
11:43 Ticket [897b96d4]: 3 changes (artifact: 75d8455e user: dan)
2009-10-08
08:15 New ticket [897b96d4]. (artifact: ae7a158a user: dan)

Ticket Hash: 897b96d49d16dcc4dcfa5bd88ded30700e74bc94
Title: SQLITE_CANTOPEN when using journal_mode=persist and async IO
Status: Deferred Type: Code_Defect
Severity: Minor Priority: Immediate
Subsystem: Extensions Resolution: Open
Last Modified: 2009-10-19 11:43:27
Version Found In: 3.6.18
Description:
Steps to reproduce:
  1. not call sqlite3async_run();
  2. open new not yet existing database;
  3. execute PRAGMA journal_mode = PERSIST;
  4. execute any 2 statements needing a transaction, e.g. some CREATE TABLE

Tcl test code:

sqlite3 db test.db -vfs sqlite3async
sqlite3 db2 test.db -vfs sqlite3async
do_test async4-3.1 {
  execsql {
    PRAGMA journal_mode = PERSIST;
    CREATE TABLE t1(a, b);
  }
} {persist}
do_test async4-3.2 {
  execsql { CREATE TABLE t2(a, b) } db2
} {}
do_test async4.3.X {
  db close
  db2 close
  sqlite3async_control halt idle
  sqlite3async_start
  sqlite3async_wait
} {}

Test case async4-3.2 fails with "Error: unable to open database file".


dan added on 2009-10-19 11:43:11:
This is a real bug, and it is possible to fix it. However, the nature of the fix is such that it would quite possibly introduce other, more serious bugs (the kind that can cause database corruption). For this reason, this will not be fixed in the short term.

For now, the resolution is to consider async IO and persistent-journal mode incompatible.