sqlite-android icon indicating copy to clipboard operation
sqlite-android copied to clipboard

SupportSQLiteDatabase.setMaxSqlCacheSize(0) throws IllegalArgumentException

Open benasher44 opened this issue 6 years ago • 1 comments

Setting the maxSqlCacheSize to 0 is allowed according to the SupportSQLiteDatabase database docs and the bounds check here. However, setting 0 crashes the PreparedStatementCache because its parent class does not allow 0 as a value:

java.lang.IllegalArgumentException: maxSize <= 0
        at androidx.collection.LruCache.<init>(LruCache.java:53)
        at io.requery.android.database.sqlite.SQLiteConnection$PreparedStatementCache.<init>(SQLiteConnection.java:1334)

benasher44 avatar Apr 19 '19 21:04 benasher44

FWIW, Android has the same bug :/

benasher44 avatar Jan 16 '20 22:01 benasher44