Open brodycj opened 8 years ago
As reported by @reconka in litehelpers/Cordova-sqlite-storage/issues/405:
I noticed the IOS application crash when I try to select rows which contains infinite number. here is my simple test: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { var db = window.sqlitePlugin.openDatabase("Database", "1.0", "Demo", -1); db.transaction(function(tx) { tx.executeSql('DROP TABLE IF EXISTS test_table'); tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id REAL)'); tx.executeSql("INSERT INTO test_table (id) VALUES (?)", ['9e999'], function(tx, res) { console.log("insertId: " + res.insertId + " -- probably 1"); // check #18/#38 is fixed alert("insertId: " + res.insertId + " -- should be valid"); db.transaction(function(tx) { tx.executeSql("SELECT id from test_table;", [], function(tx, res) { alert("res.rows.length: " + res.rows.length + " -- should be 1"); }); }); }, function(e) { console.log("ERROR: " + e.message); }); }); } And ERROR msg: \ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid number value (infinite) in JSON write'
I noticed the IOS application crash when I try to select rows which contains infinite number.
here is my simple test:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { var db = window.sqlitePlugin.openDatabase("Database", "1.0", "Demo", -1); db.transaction(function(tx) { tx.executeSql('DROP TABLE IF EXISTS test_table'); tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id REAL)'); tx.executeSql("INSERT INTO test_table (id) VALUES (?)", ['9e999'], function(tx, res) { console.log("insertId: " + res.insertId + " -- probably 1"); // check #18/#38 is fixed alert("insertId: " + res.insertId + " -- should be valid"); db.transaction(function(tx) { tx.executeSql("SELECT id from test_table;", [], function(tx, res) { alert("res.rows.length: " + res.rows.length + " -- should be 1"); }); }); }, function(e) { console.log("ERROR: " + e.message); }); }); }
And ERROR msg: \ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid number value (infinite) in JSON write'
Will be fixed in this version.
As reported by @reconka in litehelpers/Cordova-sqlite-storage/issues/405:
Will be fixed in this version.