nolanlawson / cordova-plugin-sqlite-2

Native SQLite database API for Cordova/PhoneGap/Ionic, modeled after WebSQL (UNMAINTAINED)
https://nolanlawson.com/2016/04/10/introducing-the-cordova-sqlite-plugin-2/
Apache License 2.0
168 stars 28 forks source link

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

Open nolanlawson opened 7 years ago

nolanlawson commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

knubie commented 1 year ago

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