This issue seems to have been introduced in one of the recent releases - setting PRAGMA cache_size to zero is a no-op and the default (2000 pages) will be used if it's done right after opening a database. The reason seems to be that sPragmaNames entry for cache_size has mPragFlag value of zero, it probably has to be PragFlag_NeedSchema, to avoid this issue.
- [sqlite] setting cache_size to 0 right after opening a c... Ousherovitch Alex
- [sqlite] setting cache_size to 0 right after openin... Richard Hipp
- [sqlite] setting cache_size to 0 right after op... Richard Hipp