lundi 10 août 2015

Why would sqlite3 fail to set cache_size?

I'm trying to track down a strange bug reported by one user of an iOS app. The crash happens here:

if(sqlite3_exec(database, "pragma cache_size=50;", NULL, NULL, NULL) != SQLITE_OK) 
{
    NSAssert1(0, @"Error: failed to set cache size");
}

The assertion trips for just this one user. However, this call has always returned SQLITE_OK for years and for countless users, in the wild and in testing, without ever tripping the assert.

I can't reproduce this problem myself, even with the same hardware, iOS version and SQLite database, so I'm a bit stumped.

What could cause pragma cache_size = X to fail?

Aucun commentaire:

Enregistrer un commentaire