From 82322623a209dad4bddb04a95af3b5819de3d7c0 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Sun, 7 Oct 2018 21:15:57 -0400 Subject: [PATCH] Windows error test & doc fixes (existing behavior) ref: - litehelpers/Cordova-sqlite-storage#539 - litehelpers/Cordova-sqlite-storage#821 --- README.md | 6 +++--- spec/www/spec/db-tx-error-mapping-test.js | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4d74173da..90049ca5c 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ See the [Sample section](#sample) for a sample with a more detailed explanation - It is NOT possible to use this plugin with the default "Any CPU" target. A specific target CPU type MUST be specified when building an app with this plugin. - Truncation issue with UNICODE `\u0000` character (same as `\0`) - No background processing - - INCORRECT error code (0) and INCONSISTENT error message (missing actual error info) in error callbacks ref: [litehelpers/Cordova-sqlite-storage#539](https://github.com/litehelpers/Cordova-sqlite-storage/issues/539) + - INCONSISTENT error code (0) and INCORRECT error message (missing actual error info) in error callbacks ref: [litehelpers/Cordova-sqlite-storage#539](https://github.com/litehelpers/Cordova-sqlite-storage/issues/539) - Not possible to SELECT BLOB column values directly. It is recommended to use built-in HEX function to retrieve BLOB column values, which should work consistently across all platform implementations as well as (WebKit) Web SQL. Non-standard BASE64 function to SELECT BLOB column values in Base64 format is supported by [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) (permissive license terms) and [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms). - Windows platform version uses `UTF-16le` internal database encoding while the other platform versions use `UTF-8` internal encoding. (`UTF-8` internal encoding is preferred ref: [litehelpers/Cordova-sqlite-storage#652](https://github.com/litehelpers/Cordova-sqlite-storage/issues/652)) - Known issue with database names that contain certain US-ASCII punctuation and control characters (see below) @@ -538,7 +538,7 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww - Known issue(s) with of certain ASCII/UNICODE characters as described below. - Boolean `true` and `false` values are handled by converting them to the "true" and "false" TEXT string values, same as WebKit Web SQL on Android and iOS. This does not seem to be 100% correct as discussed in: [litehelpers/Cordova-sqlite-storage#545](https://github.com/litehelpers/Cordova-sqlite-storage/issues/545) - A number of uncategorized errors such as CREATE VIRTUAL TABLE USING bogus module are reported with error code 5 (SQLError.SYNTAX_ERR) on Android/iOS/macOS by both (WebKit) Web SQL and this plugin. -- Issues with error code on Windows as well as Android with the `androidDatabaseImplementation: 2` setting described below. +- Error is reported with error code of `0` on Windows as well as Android with the `androidDatabaseImplementation: 2` setting. - In case of an issue that causes an API function to throw an exception (Android/iOS WebKit) Web SQL includes includes a code member with value of 0 (SQLError.UNKNOWN_ERR) in the exception while the plugin includes no such code member. - This plugin supports some non-standard features as documented below. - Results of SELECT with BLOB data such as `SELECT LOWER(X'40414243') AS myresult`, `SELECT X'40414243' AS myresult`, or reading data stored by `INSERT INTO MyTable VALUES (X'40414243')` are not consistent on Android in case the built-in Android database is used (using the `androidDatabaseImplementation: 2` setting in `window.sqlitePlugin.openDatabase`) or Windows. (These work with Android/iOS WebKit Web SQL and have been supported by SQLite for a number of years.) @@ -579,7 +579,7 @@ See **Security of sensitive data** in the [Security](#security) section above. - Memory issue observed when adding a large number of records due to the JSON implementation which is improved in [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) (GPL or commercial license terms) - Infinity (positive or negative) values are not supported on Android/iOS/macOS due to issues described above including a possible crash on iOS/macOS ref: [litehelpers/Cordova-sqlite-storage#405](https://github.com/litehelpers/Cordova-sqlite-storage/issues/405) - A stability issue was reported on the iOS platform version when in use together with [SockJS](http://sockjs.org/) client such as [pusher-js](https://github.com/pusher/pusher-js) at the same time (see [litehelpers/Cordova-sqlite-storage#196](https://github.com/litehelpers/Cordova-sqlite-storage/issues/196)). The workaround is to call sqlite functions and [SockJS](http://sockjs.org/) client functions in separate ticks (using setTimeout with 0 timeout). -- SQL errors are reported with an INCORRECT error code (0) on Windows ref: [litehelpers/Cordova-sqlite-storage#539](https://github.com/litehelpers/Cordova-sqlite-storage/issues/539). In certain cases SQL errors are also reported with error code 0 on Android in case the built-in Android database is used (using the `androidDatabaseImplementation: 2` setting in `window.sqlitePlugin.openDatabase`). +- SQL errors are reported with incorrect & inconsistent error message on Windows - missing actual error info ref: [litehelpers/Cordova-sqlite-storage#539](https://github.com/litehelpers/Cordova-sqlite-storage/issues/539). - Close/delete database bugs described below. - When a database is opened and deleted without closing, the iOS/macOS platform version is known to leak resources. - It is NOT possible to open multiple databases with the same name but in different locations (iOS/macOS platform version). diff --git a/spec/www/spec/db-tx-error-mapping-test.js b/spec/www/spec/db-tx-error-mapping-test.js index d50ce2142..4960b1511 100755 --- a/spec/www/spec/db-tx-error-mapping-test.js +++ b/spec/www/spec/db-tx-error-mapping-test.js @@ -35,10 +35,7 @@ var mytests = function() { // TBD skip plugin test on browser platform (not yet supported): if (isBrowser && (i === 0)) continue; - describe(scenarioList[i] + ': db tx error mapping test(s)' + - (isWindows ? - ' [Windows version with INCORRECT error code (0) & INCONSISTENT error message (missing actual error info)]' : - ''), function() { + describe(scenarioList[i] + ': db tx error mapping test(s) [TBD INCORRECT & INCONSISTENT error message on Windows - missing actual error info ref: litehelpers/Cordova-sqlite-storage#539]', function() { var scenarioName = scenarioList[i]; var suiteName = scenarioName + ': '; var isWebSql = (i === 1);