cordova-plugin-sqlite-2 icon indicating copy to clipboard operation
cordova-plugin-sqlite-2 copied to clipboard

Android: should throw meaningful errors when the 1MB CursorWindow limit is reached

Open nolanlawson opened this issue 8 years ago • 3 comments

Currently these errors just get swallowed, e.g.: https://github.com/pouchdb/pouchdb/issues/5413

We just return empty results which causes bugs later on down the line that are hard to diagnose: https://github.com/nolanlawson/cordova-plugin-sqlite-2/blob/33afdef8409b8782b7a82ca7d59270e7e11541dd/src/android/SQLitePlugin.java#L93-L96

nolanlawson avatar Dec 18 '16 21:12 nolanlawson

Hm interestingly this doesn't seem to actually throw an error we can catch; it just returns empty rows. Although it does log:

12-18 12:49:43.189 21171 21346 W CursorWindow: Window is full: requested allocation 2236848 bytes, free space 2096672 bytes, window size 2097152 bytes
12-18 12:49:43.205 21171 21346 W CursorWindow: Window is full: requested allocation 2236848 bytes, free space 2096672 bytes, window size 2097152 bytes

nolanlawson avatar Dec 18 '16 21:12 nolanlawson

Hm from googling around I really don't see any way to actually detect this error in code. :confused:

nolanlawson avatar Dec 18 '16 21:12 nolanlawson

Related issue at andpor/react-native-sqlite-storage#364

knubie avatar Oct 06 '22 19:10 knubie