SQLITE_IOERR on `pragma optimize`
I'm sometimes getting
SQLITE_IOERR from sqlite 3.28.0 when I run
pragma optimize (with no mask) prior to closing a connection, and I'm at a loss for what to do about it.
pragma optimize(0xffff) gives me
which seems reasonable, but then
ANALYZE "main"."causal_parent" ANALYZE "main"."causal"
pragma optimize, immediately following that, crashes.
It's a new database, created by a unit test. I don't get a crash if I don't run
P.S. Fwiw, I do use
PRAGMA journal_mode = WAL; after db open.
I'm confused. Is "PRAGMA Optimize" returning an SQLITE_IOERR or is it crashing? Which is it?
Sorry for the confusion; the library/language bindings for sqlite that I'm using crashes on
PRAGMA optimize is returning
My suspicion that the journal_mode is a factor seems have borne out; I don't see get the error with
PRAGMA journal_mode = delete, but I had wanted
journal_mode = wal for performance reasons; more important than
PRAGMA optimize, I suppose.
But I'm surprised that
PRAGMA optimize would return
SQLITE_IOERR at all; is that expected? I'm on macOS and using a local file system.