-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinity values in SQLite #405
Comments
See litehelpers/cordova-sqlite-evplus-ext-legacy-build-free/issues/4: this issue will be fixed in litehelpers / Cordova-sqlite-enterprise-free (available under GPL and commercial licensing terms). Will be documented here when I get a chance. |
Reproduced in a simpler test: it(suiteName + "SELECT abs('9e999') (Infinity) result test", function(done) {
var db = openDatabase('Infinite-results-test.db', '1.0', 'Test', DEFAULT_SIZE);
db.transaction(function(tx) {
expect(tx).toBeDefined();
tx.executeSql('SELECT abs(?) AS absResult', ['9e999'], function(tx, res) {
expect(res).toBeDefined();
expect(res.rows).toBeDefined();
expect(res.rows.length).toBe(1);
expect(res.rows.item(0).absResult).toBeDefined();
expect(res.rows.item(0).absResult).toBe(Infinity);
// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
});
});
}, MYTIMEOUT); On iOS it crashes with the error as already reported:
I think this is due to the way Cordova attempts to encode the JSON result. This test also fails on the Android version of the plugin. This may be handled in a different issue. This test passes on Web SQL (Android and iOS) and the Windows platform. This test fails on WP8 (legacy version). |
Now reported in Apache CB-11737 |
Additional findings:
I I think the easiest way to fix the plugin to handle +/- |
Reproduce more +/- Infinity issues on Android/iOS plugin (ref: storesafe#405) Additional error code/message check
Issues on macOS ("osx") and Android have been reproduced as well. Quick summary (general):
|
Hi,
I noticed the IOS application crash when I try to select rows which contains infinite number.
here is my simple test:
And ERROR msg:
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid number value (infinite) in JSON write'
The text was updated successfully, but these errors were encountered: