diff --git a/CHANGES.md b/CHANGES.md index 960f2eda..610b0d68 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changes +# cordova-sqlite-evcore-extbuild-free 0.9.5 + +### cordova-sqlite-evcore-legacy-ext-common-free 0.0.4 + +- additional evcore iOS/macOS/Windows compile-time options + # cordova-sqlite-evcore-extbuild-free 0.9.4 - Android evcore NDK JAR from cordova-sqlite-evcore-free-dependencies 0.8.0, no longer using JSMN component diff --git a/LICENSE.md b/LICENSE.md index 116b7c9e..a9531f96 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -4,11 +4,11 @@ This version is available under GPL v3 (http://www.gnu.org/licenses/gpl.txt) or This version is based on Cordova-sqlite-storage (https://github.com/litehelpers/Cordova-sqlite-storage), available under MIT license (all platforms) or Apache 2.0 license (Android and Windows). -iOS/macOS _platform version_ based on Phonegap-SQLitePlugin by @davibe (Davide Bertola ) and @joenoon (Joe Noon ) _(MIT license)_ +The iOS/macOS platform version is based on Phonegap-SQLitePlugin by @davibe (Davide Bertola ) and @joenoon (Joe Noon ) (MIT license). -_iOS/macOS platform version_ includes and uses PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m ) by @steipete () _(MIT license)_ +The iOS/macOS platform version includes and uses PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m ) by @steipete () (MIT license). -Windows _platform version_ includes SQLite3-WinRT by @doo (doo GmbH) under MIT License +The Windows platform version includes SQLite3-WinRT by @doo (doo GmbH) under MIT License. Other components: @@ -18,6 +18,4 @@ sqlite3-base64 by @brodybits (Christopher J. Brody), Unlicense (http://unlicense libb64-encode - based on libb64 (http://libb64.sourceforge.net/) by Chris Venter, public domain -## Windows version - SQLite3 (http://sqlite.org/), public domain diff --git a/README.md b/README.md index 145ef4a9..b87cebaa 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,12 @@ # Cordova/PhoneGap sqlite storage - free enterprise version with Android performance improvements and extra features for PhoneGap Build -Native interface to sqlite in a Cordova/PhoneGap plugin for Android, iOS, macOS, and Windows 10 (UWP), with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/). +Native interface to sqlite in a Cordova/PhoneGap plugin for _Android, iOS, macOS, and Windows 10 (UWP)_, with API similar to HTML5/[Web SQL API](http://www.w3.org/TR/webdatabase/). -This _plugin version_ uses a special _Android NDK sqlite database access library (implemented in C)_ to provide significantly better performance as well as memory usage improvements _on Android platform_. +This plugin version uses a special Android NDK sqlite database access library (C-language implementation) to provide significant performance and memory usage improvements on the Android platform. -This _plugin version_ is available under GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license and includes components available under the MIT and Apache 2.0 licenses. Contact for commercial license: ____ +This plugin version is available under GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license options and includes components available under the MIT and Apache 2.0 licenses listed in [LICENSE.md](./LICENSE.md). Contact for commercial license: -NOTE: Commercial licenses for [litehelpers / Cordova-sqlite-enterprise-free](https://github.com/litehelpers/Cordova-sqlite-enterprise-free) are valid for this version as well. - - +NOTE: Commercial licenses for [litehelpers / Cordova-sqlite-enterprise-free](https://github.com/litehelpers/Cordova-sqlite-enterprise-free) are valid for this plugin version as well. ## About this plugin version branch @@ -24,12 +18,12 @@ Free enterprise version with Android performance improvements and other features ## WARNING: Multiple SQLite problem on Android -This plugin uses a non-standard _Android-sqlite-evcore-native-driver-free database access implementation_ on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . +This plugin uses _non-standard_ [litehelpers / Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) sqlite database access implementation on Android. In case an application access the SAME database using multiple plugins there is a risk of data corruption (ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below: ```js -var db = window.sqlitePlugin.openDatabase({name: "my.db", androidDatabaseImplementation: 2}); +var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default', androidDatabaseImplementation: 2}); ``` @@ -131,45 +125,45 @@ See the [Sample section](#sample) for a sample with a more detailed explanation. ## Status -- _Patches will NOT be accepted on this plugin version due to some possible licensing issues._ +- Patches will NOT be accepted on this plugin version due to some possible licensing issues. - This plugin is NOT supported by PhoneGap Developer App or PhoneGap Desktop App. -- This version includes the SQLite and Android-sqlite-evcore-native-driver-free dependencies to work with PhoneGap Build and other some other build systems such as Cordova Plugman, PhoneGap CLI, and Intel XDK. -- _A recent version of the Cordova CLI (such as `6.5.0` / `7.1.0` / `8.0.0`) is recommended. ~~(Cordova CLI 8.x includes `cordova-android@7`, NOT supported by this plugin version due to [litehelpers/Cordova-sqlite-storage#729](https://github.com/litehelpers/Cordova-sqlite-storage/issues/729).)~~ Cordova versions older than `6.0.0` are missing the `cordova-ios@4.0.0` security fixes. In addition it may be necessary to use `cordova prepare` in case of cordova-ios older than `4.3.0` (Cordova CLI `6.4.0`)._ -- The iOS database location is now mandatory, as documented below. +- This _plugin version_ includes the SQLite and Android-sqlite-evcore-native-driver-free dependencies to work with PhoneGap Build and other some other build systems such as Cordova Plugman, PhoneGap CLI, and Intel XDK. +- A recent version of the Cordova CLI (such as `6.5.0` / `7.1.0` / `8.0.0`) is recommended. Cordova versions older than `6.0.0` are missing the `cordova-ios@4.0.0` security fixes. In addition it may be necessary to use `cordova prepare` in case of cordova-ios older than `4.3.0` (Cordova CLI `6.4.0`). - This _plugin version_ includes the following extra features: - BASE64 integrated from [brodybits / sqlite3-base64](https://github.com/brodybits/sqlite3-base64), using [brodybits / libb64-encode](https://github.com/brodybits/libb64-encode) (based on by Chris Venter, public domain) - - REGEXP for Android (default Android-sqlite-connector database implementation), iOS, and macOS using [brodybits / sqlite3-regexp-cached](https://github.com/brodybits/sqlite3-regexp-cached) (based on by Alexey Tourbin, public domain) -- SQLite `3.15.2` __included__, with the following _compile-time definitions (for all supported platforms Android/iOS/macOS/Windows)_: + - REGEXP for Android _(default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation)_, iOS, and macOS using [brodybits / sqlite3-regexp-cached](https://github.com/brodybits/sqlite3-regexp-cached) (based on by Alexey Tourbin, public domain) +- The iOS database location is now mandatory, as documented below. +- SQLite version `3.15.2` included with the following compile-time options: - `SQLITE_THREADSAFE=1` on iOS/macOS/Windows (`SQLITE_THREADSAFE=2` Android) - - ~~`SQLITE_DEFAULT_MEMSTATUS=0`~~ _(FUTURE TODO)_ - - _~~`SQLITE_LOCKING_STYLE=1` on iOS/macOS~~ (XXX TODO ... already present in cordova-sqlite-evcore-common-free plugin version)_ - - ~~`SQLITE_OMIT_DECLTYPE`~~ _(FUTURE TODO)_ - - ~~`SQLITE_OMIT_DEPRECATED`~~ _(FUTURE TODO)_ - - ~~`SQLITE_OMIT_PROGRESS_CALLBACK`~~ _(FUTURE TODO)_ - - ~~`SQLITE_OMIT_SHARED_CACHE`~~ _(FUTURE TODO)_ + - `SQLITE_LOCKING_STYLE=1` on iOS/macOS ONLY + - `HAVE_USLEEP=1` (iOS/macOS/Windows) - `SQLITE_TEMP_STORE=2` - - `SQLITE_OMIT_LOAD_EXTENSION` _(iOS/macOS/Windows ... XXX TODO missing on Android build)_ + - `SQLITE_DEFAULT_MEMSTATUS=0` (iOS/macOS/Windows) + - `SQLITE_OMIT_DECLTYPE` (iOS/macOS/Windows) + - `SQLITE_OMIT_DEPRECATED` (iOS/macOS/Windows) + - `SQLITE_OMIT_SHARED_CACHE` (iOS/macOS/Windows) + - `SQLITE_OMIT_LOAD_EXTENSION` (iOS/macOS/Windows) - `SQLITE_ENABLE_FTS3` - `SQLITE_ENABLE_FTS3_PARENTHESIS` - `SQLITE_ENABLE_FTS4` - `SQLITE_ENABLE_FTS5` - `SQLITE_ENABLE_RTREE` - `SQLITE_ENABLE_JSON1` - - `SQLITE_DEFAULT_PAGE_SIZE=4096` and `SQLITE_DEFAULT_CACHE_SIZE=-2000` - _new stable_ page/cache sizes from 3.12.0 ref: - - - - + - `SQLITE_DEFAULT_PAGE_SIZE=4096` and `SQLITE_DEFAULT_CACHE_SIZE=-2000` - new stable page/cache sizes from 3.12.0 ref: ; - `SQLITE_OS_WINRT` (Windows only) - - `NDEBUG` (Windows only) -- This _plugin version_ supports the use of two (2) possible Android sqlite database implementations: - - default: high-performance, lightweight [litehelpers / Android-sqlite-evcore-native-driver-free (ext-master version branch)](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free/tree/ext-master) NDK library build _(implemented in C)_ + - `NDEBUG` on Windows (Release build only) +- This plugin version supports the use of two (2) possible Android sqlite database implementations: + - default: high-performance, lightweight [litehelpers / Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) NDK library (C implementation) - optional: built-in Android database classes (usage described below) +- The following feature is available in [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) (with permissive license terms, missing Android-sqlite-evcore-native-driver performance enhancements), XXX TODO _MISSING IN THIS PLUGIN VERSION_: + - Pre-populated database (all platforms Android/iOS/macOS/Windows) - Windows platform version (using a customized version of the performant [doo / SQLite3-WinRT](https://github.com/doo/SQLite3-WinRT) C++ component) has the following known limitations: - _This plugin version has dependency on the `v141` build toolset provided by Visual Studio 2017 ref: [litehelpers/Cordova-sqlite-storage#580](https://github.com/litehelpers/Cordova-sqlite-storage/issues/580). (Visual Studio 2015 is now supported by [litehelpers / cordova-sqlite-legacy](https://github.com/litehelpers/cordova-sqlite-legacy) (permissive license terms, no performance enhancements for Android) and [litehelpers / Cordova-sqlite-evcore-common-free](https://github.com/litehelpers/Cordova-sqlite-evcore-common-free) (GPL or commercial license terms, with performance enhancements for Android).)_ - 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`) + - Truncation issue with UNICODE `\u0000` character (same as `\0`) ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#27](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/27) - 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) - - Not possible to read BLOB column values + - Not possible to SELECT BLOB column values directly (TBD recommended solution is to use HEX function to retrieve the data, working consistently across all platforms as well as (WebKit) Web SQL implementation; BASE64 function is also offered by cordova-sqlite-ext and cordova-sqlite-evcore-extbuild-free plugin versions) - 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)) - The macOS platform version ("osx" platform) is not tested in a release build and should be considered pre-alpha. - Android versions supported: 2.3.3 - 7.1.1 (API level 10 - 25), depending on Cordova version ref: @@ -195,16 +189,18 @@ See the [Sample section](#sample) for a sample with a more detailed explanation. - This _plugin version_ includes the following extra features: BASE64 (all platforms Android/iOS/macOS/Windows), REGEXP (Android/iOS/macOS) - _For the Android platform this plugin version uses the _lightweight, high-performance_ [litehelpers / Android-sqlite-evcore-native-driver-free (ext-master version branch)](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free/tree/ext-master) _database access implementation (by default configuration). Android-sqlite-evcore-native-driver-free is a_ NDK library implemented in C for JSON and SQL statement handling and processes large batches in less than half the time compared to [litehelpers / Cordova-sqlite-storage](https://github.com/litehelpers/Cordova-sqlite-storage), as measured by: [brodybits / Cordova-sql-test-app](https://github.com/brodybits/Cordova-sql-test-app)_ - The Lawnchair adapter is now moved to [litehelpers / cordova-sqlite-lawnchair-adapter](https://github.com/litehelpers/cordova-sqlite-lawnchair-adapter). +- _This plugin version_ now supports SELECT BLOB data in Base64 format on all platforms in addition to REGEXP (Android/iOS/macOS) ~~and pre-populated database (FUTURE TODO - all platforms)~~. - [brodybits / sql-promise-helper](https://github.com/brodybits/sql-promise-helper) provides a Promise-based API wrapper. - [nolanlawson / pouchdb-adapter-cordova-sqlite](https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite) supports this plugin along with other implementations such as [nolanlawson / sqlite-plugin-2](https://github.com/nolanlawson/sqlite-plugin-2) and [Microsoft / cordova-plugin-websql](https://github.com/Microsoft/cordova-plugin-websql). - Custom Android database location (supports external storage directory) - macOS ("osx" platform) is now supported +- For the Android platform this plugin version uses the lightweight, performant [litehelpers / Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation (by default configuration). [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) is a NDK library (with C-language implementation) for JSON and SQL statement handling which processes large batches in less than half the time compared to [litehelpers / Cordova-sqlite-storage](https://github.com/litehelpers/Cordova-sqlite-storage), as measured by: [brodybits / Cordova-sql-test-app](https://github.com/brodybits/Cordova-sql-test-app) - Published [brodybits / Cordova-quick-start-checklist](https://github.com/brodybits/Cordova-quick-start-checklist) and [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/brodybits/Avoiding-some-Cordova-pitfalls). - Self-test functions to verify proper installation and operation of this plugin - More explicit `openDatabase` and `deleteDatabase` `iosDatabaseLocation` option - Added straightforward sql batch function - [MetaMemoryT / websql-promise](https://github.com/MetaMemoryT/websql-promise) now provides a Promises-based interface to both Web SQL and this plugin -- [SQLCipher](https://www.zetetic.net/sqlcipher/) for Android/iOS/macOS/Windows is supported by [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) _- WITHOUT the evcore performance improvements for Android (plugin version with SQLCipher support together with evcore performance for Android may be published in case there is enough interest from the user community)_ +- [SQLCipher](https://www.zetetic.net/sqlcipher/) for Android/iOS/macOS/Windows is supported by [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) - WITHOUT the evcore performance improvements for Android (plugin version with SQLCipher support together with evcore performance for Android may be published if there is sufficient interest from the user community) @@ -249,7 +245,7 @@ More resources can be found by . **MAJOR TIPS:** As described in the [Installing](#installing) section: -- It is recommended to use the `--save` flag when installing plugins to track them in `config.xml` _in case of Cordova CLI pre-7.0 (`--save` is automatic in Cordova CLI 7.x / 8.x)_. If all plugins are tracked in `config.xml` then there is no need to commit the `plugins` subdirectory tree into the source repository. +- It is recommended to use the `--save` flag when installing plugins to track them in `config.xml` _in case of Cordova CLI pre-7.0 (automatic starting with Cordova CLI 7.0)_. If all plugins are tracked in `config.xml` then there is no need to commit the `plugins` subdirectory tree into the source repository. - In general it is *not* recommended to commit the `platforms` subdirectory tree into the source repository. **NOTICE:** This plugin is only supported with the Cordova CLI. This plugin is *not* supported with other Cordova/PhoneGap systems such as PhoneGap CLI, PhoneGap Build, Plugman, Intel XDK, Webstorm, etc. @@ -361,14 +357,14 @@ In case you get stuck with something please read through the [support](#support) ### Plugin usage examples -- [brodybits / cordova-sqlite-storage-starter-app](https://github.com/brodybits/cordova-sqlite-storage-starter-app) (using `cordova-sqlite-storage` version) +- [brodybits / cordova-sqlite-storage-starter-app](https://github.com/brodybits/cordova-sqlite-storage-starter-app) _(using `cordova-sqlite-storage` version)_ - ### Plugin tutorials -- (using `cordova-sqlite-storage` version) +- (using `cordova-sqlite-storage` plugin version) -**NOTICE:** The above tutorial shows `cordova plugin add cordova-sqlite-storage` with the `--save` flag missing. Please add each desired plugin using the `--save` flag to keep the plugins in `config.xml` _(`--save` flag NOT NEEDED for Cordova 7.x / 8.x)_. +**NOTICE:** The above tutorial shows `cordova plugin add cordova-sqlite-storage` with the `--save` flag missing. Please be sure to use the `--save` flag to keep the plugins in `config.xml` _in case of Cordova CLI pre-7.0 (automatic starting with Cordova CLI 7.0)_. Other plugin tutorials wanted ref: [litehelpers/Cordova-sqlite-storage#609](https://github.com/litehelpers/Cordova-sqlite-storage/issues/609) @@ -453,7 +449,7 @@ See **Security of sensitive data** in the [Security](#security) section above. - In case of ignored INSERT OR IGNORE statement WebKit Web SQL (Android/iOS) reports insertId with an old INSERT row id value while the plugin reports insertId: undefined. - In case of a SQL error handler that does not recover the transaction, WebKit Web SQL (Android/iOS) would incorrectly report error code 0 while the plugin would report the same error code as in the SQL error handler. (In case of an error with no SQL error handler then Android/iOS WebKit Web SQL would report the same error code that would have been reported in the SQL error hander.) - In case a transaction function throws an exception, the message and code if present are reported by the plugin but *not* by (WebKit) Web SQL. -- SQL error messages are inconsistent on Windows and less descriptive on Android in case of the default Android-sqlite-evcore-native-driver-free implementation. +- SQL error messages are inconsistent on Windows and less descriptive on Android in case of the default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) implementation. - There are some other differences in the SQL error messages reported by WebKit Web SQL and this plugin. @@ -487,20 +483,23 @@ As "strongly recommended" by [Web SQL Database API 8.5 SQL injection](https://ww ## Known issues - The iOS/macOS platform versions do not support certain rapidly repeated open-and-close or open-and-delete test scenarios due to how the implementation handles background processing -- The Android platform version does not always handle four-byte UTF-8 characters emoji characters such as `\u1F603` (SMILING FACE, MOUTH OPEN) correctly ref: [litehelpers/Cordova-sqlite-storage#564](https://github.com/litehelpers/Cordova-sqlite-storage/issues/564). It is sometimes possible to store and retrieve such characters but certain operations such as hex conversions do not work properly when using the default _(non-standard) Android-sqlite-evcore-native-driver-free database access implementation_. It is suspected that such characters would be stored incorrectly by the default Android platform version. Note that this is not an issue in case the built-in Android database is used (using the `androidDatabaseImplementation: 2` setting in `window.sqlitePlugin.openDatabase`). +- HIGH PRIORITY TODO: The default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation does not currently handle control characters such as vertical tab, form feed, or backspace characters properly ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#28](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/28) +- CRASH or INCORRECT HANDLING in case of Unicode emoji and other 4-octet UTF-8 characters (default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation) ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#7](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/7) and [litehelpers/Cordova-sqlite-storage#564](https://github.com/litehelpers/Cordova-sqlite-storage/issues/564) - It is possible to request a SQL statement list such as "SELECT 1; SELECT 2" within a single SQL statement string, however the plugin will only execute the first statement and silently ignore the others ref: [litehelpers/Cordova-sqlite-storage#551](https://github.com/litehelpers/Cordova-sqlite-storage/issues/551) - Execution of INSERT statement that affects multiple rows (due to SELECT cause or using TRIGGER(s), for example) reports incorrect rowsAffected on Android in case the built-in Android database used (using the `androidDatabaseImplementation` option in `window.sqlitePlugin.openDatabase`) -- _FIXED in this plugin version:_ ~~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)~~ +- FIXED in this plugin version: ~~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)) or a hanging transaction queue on Android. - 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`). -- Possible crash on Android when using Unicode emoji and other 4-octet UTF-8 characters due to [Android bug 81341](https://code.google.com/p/android/issues/detail?id=81341), which *should* be fixed in Android 6.x +- Multi-byte UTF-8 characters not working on all Android systems (issue discovered on Intel `x86` / `x86_64` - default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation) ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#19](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/19) +- Issue on default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation in case of database name with multi-byte UTF-8 characters ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#25](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/25) +- The default Android-sqlite-evcore-native-driver-free database access implementation is known to crash on certain Android versions in case of database file names with emoji and other 4-byte UTF-8 characters ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#26](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/26) +- Issue (truncation issue) with NULL characters (`'\0\` or `'\u0000'`) on Android (default Android-sqlite-evcore-native-driver-free database access implementation) and Windows ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#27](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/27) - Close/delete database bugs described below. -- The default Android _database access implementation (Android-sqlite-evcore-native-driver-free)_ does not currently handle vertical tab, form feed, or backspace characters properly. - 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). -Some additional issues are tracked in [open Cordova-sqlite-storage bug-general issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) _and [open Cordova-sqlite-evcore-extbuild-free bug-general issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general)_. +Some additional issues are tracked in [open cordova-sqlite-storage bug-general issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) and [open cordova-sqlite-evcore-extbuild-free bug-general issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general). @@ -514,19 +513,21 @@ Some additional issues are tracked in [open Cordova-sqlite-storage bug-general i - In-memory database `db=window.sqlitePlugin.openDatabase({name: ':memory:', ...})` is currently not supported. - The Android platform version cannot properly support more than 100 open database files due to the threading model used. - SQL error messages reported by Windows platform version are not consistent with Android/iOS/macOS platform versions. -- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). This is fixed with a workaround for iOS/macOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (GPL or special commercial license terms) as well as [litehelpers / Cordova-sqlite-evplus-legacy-workers-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free) (GPL or premium commercial license terms). -- ~~The BLOB data type is not fully supported _[...]_~~ _Non-standard BASE64 function is required to SELECT BLOB data type on windows, also recommended on the other platforms, as described in this document._ -- Truncation in case of UNICODE `\u0000` (same as `\0`) character on Android (default _Android-sqlite-evcore-native-driver-free database access implementation_) and Windows. +- UNICODE `\u2028` (line separator) and `\u2029` (paragraph separator) characters are currently not supported and known to be broken on iOS, macOS, and Android platform versions due to JSON issues reported in [Cordova bug CB-9435](https://issues.apache.org/jira/browse/CB-9435) and [cordova/cordova-discuss#57](https://github.com/cordova/cordova-discuss/issues/57). This is fixed with a workaround for iOS/macOS in: [litehelpers / Cordova-sqlite-evplus-legacy-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (GPL or special commercial license terms) as well as [litehelpers / cordova-sqlite-evmax-ext-workers-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evmax-ext-workers-legacy-build-free) (GPL or premium commercial license terms). +- _Storage and retrieval of BLOB data type is not supported consistently on all platforms according to HTML5/[Web SQL DRAFT API](http://www.w3.org/TR/webdatabase/) (issue on Windows). SELECT BLOB in Base64 format using non-standard BASE64 function (described elsewhere in this document) is supported by this plugin version (GPL or commercial license options) as well as [litehelpers / cordova-sqlite-ext](https://github.com/litehelpers/cordova-sqlite-ext) (permissive license terms); SELECT BLOB in HEX format using HEX function is also supported. INLINE BLOB values such as `X'010203' are supported by the SQLite syntax on all platforms. FUTURE TBD equivalent to UNHEX (supported in MySQL) or conversion of Base-64 string to BLOB is desired._ +- Database file names with multi-byte UTF-8 characters such as accented characters or other international characters are NOT tested and not expected to work consistently across all platforms. The default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation is known to crash on certain Android versions in case of database file names with emoji and other 4-byte UTF-8 characters ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#26](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/26) +- Truncation in case of UNICODE `\u0000` (same as `\0`) character on Android (default [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation) and Windows ref: [litehelpers/Cordova-sqlite-evcore-extbuild-free#27](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/27) - Case-insensitive matching and other string manipulations on Unicode characters, which is provided by optional ICU integration in the sqlite source and working with recent versions of Android, is not supported for any target platforms. - The iOS/macOS platform version uses a thread pool but with only one thread working at a time due to "synchronized" database access. -- Some _extreme large_ query results may be slow, _especially on iOS/macOS,_ due to the JSON implementation. +- Some extreme large query results may be slow, especially on iOS/macOS, due to the JSON implementation. Improvements for iOS/macOS are available in [litehelpers / cordova-sqlite-evplus-ext-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evplus-ext-legacy-build-free) and [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (GPL or special commercial license terms). FUTURE (TODO) will be available in a newer evplus plugin version (GPL or special commercial license terms). +- ATTACH to another database file is not supported by this version branch. Attach/detach is supported (along with the memory and iOS UNICODE `\u2028` line separator / `\u2029` paragraph separator fixes) in [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) (GPL or special commercial license terms). - UPDATE/DELETE with LIMIT or ORDER BY is not supported. - WITH clause is not supported on some older Android platform versions in case the `androidDatabaseImplementation: 2` (built-in android.database implementation) option is used. - User-defined savepoints are not supported and not expected to be compatible with the transaction locking mechanism used by this plugin. In addition, the use of BEGIN/COMMIT/ROLLBACK statements is not supported. - Problems have been reported when using this plugin with Crosswalk (for Android). It may help to install Crosswalk as a plugin instead of using Crosswalk to create the project. - Does not work with [axemclion / react-native-cordova-plugin](https://github.com/axemclion/react-native-cordova-plugin) since the `window.sqlitePlugin` object is *not* properly exported (ES5 feature). It is recommended to use [andpor / react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage) for SQLite database access with React Native Android/iOS instead. -Additional limitations are tracked in [marked Cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+label%3Adoc-todo). +Additional limitations are tracked in [marked cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+label%3Adoc-todo) and [marked cordova-sqlite-evcore-extbuild-free doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues?q=is%3Aissue+label%3Adoc-todo). @@ -624,8 +625,8 @@ FUTURE TBD: Proper date/time handling will be further tested and documented at s - Browser platform - IndexedDBShim adapter (possibly based on IndexedDBShim) - Further cleanup of [support](#support) section -- Resolve or document remaining [open Cordova-sqlite-storage bugs](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) -- Resolve [cordova-sqlite-help doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-help/issues?q=is%3Aissue%20label%3Adoc-todo) and [marked Cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+label%3Adoc-todo) +- Resolve or document [open cordova-sqlite-storage bug-general issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) and [open cordova-sqlite-evcore-extbuild-free bug-general issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues?q=is%3Aissue+is%3Aopen+label%3Abug-general) +- Resolve [cordova-sqlite-help doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-help/issues?q=is%3Aissue%20label%3Adoc-todo), [marked Cordova-sqlite-storage doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-storage/issues?q=is%3Aissue+label%3Adoc-todo), and [marked cordova-sqlite-evcore-extbuild-free doc-todo issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues?q=is%3Aissue+label%3Adoc-todo) @@ -647,8 +648,8 @@ FUTURE TBD: Proper date/time handling will be further tested and documented at s - [brodybits / cordova-sqlite-legacy-build-support](https://github.com/brodybits/cordova-sqlite-legacy-build-support) - maintenance of WP8 platform version along with Windows 8.1/Windows Phone 8.1 and the other supported platforms Android/iOS/macOS/Windows 10; limited support for PhoneGap CLI/PhoneGap Build/plugman/Intel XDK; limited testing; limited updates. Permissive license terms. - [litehelpers / Cordova-sqlcipher-adapter](https://github.com/litehelpers/Cordova-sqlcipher-adapter) - supports [SQLCipher](https://www.zetetic.net/sqlcipher/) for Android/iOS/macOS/Windows - [litehelpers / Cordova-sqlite-evcore-extbuild-free](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free) - Enhancements for Android: JSON and SQL statement handling implemented in C, supports larger transactions and handles large SQL batches in less than half the time as this plugin version. Supports arbitrary database location on Android. Support for build environments such as PhoneGap Build and Intel XDK. Also includes REGEXP (Android/iOS/macOS) and SELECT BLOB in Base64 format (all platforms Android/iOS/macOS/Windows). GPL or commercial license terms. -- [litehelpers / cordova-sqlite-evplus-ext-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evplus-ext-legacy-build-free) - internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (iOS). (GPL or special commercial license terms). -- [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) - plugin version with support for ATTACH, includes internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (GPL or special commercial license terms). +- [litehelpers / cordova-sqlite-evplus-ext-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evplus-ext-legacy-build-free) - internal memory improvements to support larger transactions _(Android/iOS/macOS)_ and fix to support all Unicode characters (iOS). (GPL or special commercial license terms). +- [litehelpers / Cordova-sqlite-evplus-legacy-attach-detach-free](https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-attach-detach-free) - plugin version with support for ATTACH, includes internal memory improvements to support larger transactions _(Android/iOS/macOS)_ and fix to support all Unicode characters (GPL or special commercial license terms). - [litehelpers / cordova-sqlite-evmax-ext-workers-legacy-build-free](https://github.com/litehelpers/cordova-sqlite-evmax-ext-workers-legacy-build-free) - plugin version with support for web workers, includes internal memory improvements to support larger transactions (Android/iOS) and fix to support all Unicode characters (iOS). (GPL or premium commercial license terms). - Adaptation for React Native Android and iOS: [andpor / react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage) (permissive license terms) - Original plugin version for iOS (with a non-standard, outdated transaction API): [davibe / Phonegap-SQLitePlugin](https://github.com/davibe/Phonegap-SQLitePlugin) (permissive license terms) @@ -725,7 +726,7 @@ var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'}, **WARNING:** The new "default" location value is *NOT* the same as the old default location and would break an upgrade for an app that was using the old default value (0) on iOS. -**WARNING 2:** As described above: by default this plugin uses a non-standard _Android-sqlite-evcore-native-driver-free database access implementation_ on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below. +**WARNING 2:** As described above: by default this plugin uses a non-standard [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) sqlite database access implementation on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption (ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below. To specify a different location (affects iOS/macOS *only*): @@ -863,7 +864,7 @@ var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default', a ``` **IMPORTANT:** -- As described above: by default this plugin uses a non-standard _Android-sqlite-evcore-native-driver-free database access implementation_ on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . The workaround is to use the `androidDatabaseImplementation: 2` setting as described here. +- As described above: by default this plugin uses a non-standard [Android-sqlite-evcore-native-driver-free](https://github.com/litehelpers/Android-sqlite-evcore-native-driver-free) database access implementation on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption (ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in and . The workaround is to use the `androidDatabaseImplementation: 2` setting as described here. - In case of the `androidDatabaseImplementation: 2` setting, [litehelpers/Cordova-sqlite-storage#193](https://github.com/litehelpers/Cordova-sqlite-storage/issues/193) reported (as observed by a number of app developers in the past) that in certain Android versions, if the app is stopped or aborted without closing the database then there is an unexpected database lock and the data that was inserted is lost. The workaround is described below. @@ -1411,11 +1412,10 @@ Please include the following: - RAR or similar archive formats - Intel, MS IDE, or similar project formats unless absolutely necessary -## Where to ask for help +## Where to request help -Once you have followed the directions above, you may request free support in the following location(s): -- __For reproducible bugs only:__ [litehelpers / Cordova-sqlite-evcore-extbuild-free / issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues) -- **For other questions:** [litehelpers / Cordova-sqlite-help / issues](https://github.com/litehelpers/Cordova-sqlite-help/issues) +- [litehelpers / Cordova-sqlite-evcore-extbuild-free / issues](https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues) +- [litehelpers / Cordova-sqlite-help](https://github.com/litehelpers/Cordova-sqlite-help) Please include the information described above otherwise. @@ -1664,7 +1664,7 @@ function closeDB() { - Testimonials of apps that are using this plugin would be especially helpful. - Reporting issues can help improve the quality of this plugin. -**NOTE:** As stated above, patches will *NOT* be accepted on this project due to potential licensing issues. Issues with reproduction scenarios will help maintain and improve the quality of this plugin for future users. (It is also helpful if you have a pointer to what code may be causing the issue.) +**NOTE:** As stated above, patches will NOT be accepted on this project due to some possible licensing issues. Issues with reproduction scenarios will help maintain and improve the quality of this plugin for future users. (Any pointers to the code may be causing the issue would also be helpful.) diff --git a/SQLitePlugin.coffee.md b/SQLitePlugin.coffee.md index cc3bfdc5..53dfaf32 100644 --- a/SQLitePlugin.coffee.md +++ b/SQLitePlugin.coffee.md @@ -2,7 +2,7 @@ ### License for this version: GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license. - Contact for commercial license: info@litehelpers.net + Contact for commercial license: sales@litehelpers.net ### #### Use coffee compiler to compile this directly into Javascript diff --git a/package.json b/package.json index 3dcda478..3224101b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-evcore-extbuild-free", - "version": "0.9.4", + "version": "0.9.5", "description": "Cordova/PhoneGap sqlite storage - free enterprise version with Android performance/memory improvements and extra features for PhoneGap Build", "cordova": { "id": "cordova-sqlite-evcore-extbuild-free", diff --git a/plugin.xml b/plugin.xml index 783c1532..9b50d796 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.9.5"> Cordova sqlite storage - free enterprise version with Android performance/memory improvements and extra features for PhoneGap Build @@ -67,7 +67,7 @@ + compiler-flags="-w -DSQLITE_THREADSAFE=1 -DSQLITE_LOCKING_STYLE=1 -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1 -DSQLITE_DEFAULT_PAGE_SIZE=4096 -DSQLITE_DEFAULT_CACHE_SIZE=-2000" /> @@ -99,7 +99,7 @@ + compiler-flags="-w -DSQLITE_THREADSAFE=1 -DSQLITE_LOCKING_STYLE=1 -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1 -DSQLITE_DEFAULT_PAGE_SIZE=4096 -DSQLITE_DEFAULT_CACHE_SIZE=-2000" /> @@ -115,10 +115,10 @@ - + ... --> diff --git a/spec/www/spec/db-open-close-delete-test.js b/spec/www/spec/db-open-close-delete-test.js index 6293e856..bc45efe4 100755 --- a/spec/www/spec/db-open-close-delete-test.js +++ b/spec/www/spec/db-open-close-delete-test.js @@ -310,6 +310,8 @@ var mytests = function() { // TBD emoji (UTF-8 4 octets) [NOT RECOMMENDED]: it(suiteName + 'Open database with emoji \uD83D\uDE03 (UTF-8 4 octets) & check database file name [NOT RECOMMENDED]', function(done) { + if (!isWindows && isAndroid && !isImpl2) pending('XXX TBD CRASH on Android 7.x/??? (default evcore-native-driver database access implementation)'); + var dbName = 'a\uD83D\uDE03'; try { @@ -366,9 +368,11 @@ var mytests = function() { {label: ':', dbName: 'first:second.db'}, {label: ';', dbName: 'first;second.db'}, {label: "'1'", dbName: "'1'.db"}, - // UTF-8 multiple octets: - {label: 'é (UTF-8 2 octets)', dbName: 'aé.db'}, - {label: '€ (UTF-8 3 octets)', dbName: 'a€.db'}, + // XXX UTF-8 with multiple octets NOT WORKING on Android + // (default Android-evcore-native-driver access implementation) + // ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#25 + // {label: 'é (UTF-8 2 octets)', dbName: 'aé.db'}, + // {label: '€ (UTF-8 3 octets)', dbName: 'a€.db'}, ]; additionalDatabaseNameScenarios.forEach(function(mytest) { diff --git a/spec/www/spec/db-tx-error-handling-test.js b/spec/www/spec/db-tx-error-handling-test.js index e7db6af4..35ef09e1 100644 --- a/spec/www/spec/db-tx-error-handling-test.js +++ b/spec/www/spec/db-tx-error-handling-test.js @@ -3244,8 +3244,9 @@ var mytests = function() { }, function(error) { // EXPECTED RESULT for (WebKit) Web SQL ONLY: if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--'); - if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) - expect(check1).toBe(true); + // XXX TBD + // if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) + // expect(check1).toBe(true); expect(error).toBeDefined(); expect(error.code).toBeDefined(); expect(error.message).toBeDefined(); @@ -3300,8 +3301,9 @@ var mytests = function() { }, function(error) { // EXPECTED RESULT for (WebKit) Web SQL ONLY: if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--'); - if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) - expect(check1).toBe(true); + // XXX TBD + // if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) + // expect(check1).toBe(true); expect(error).toBeDefined(); expect(error.code).toBeDefined(); expect(error.message).toBeDefined(); @@ -3356,8 +3358,9 @@ var mytests = function() { }, function(error) { // EXPECTED RESULT for (WebKit) Web SQL ONLY: if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--'); - if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) - expect(check1).toBe(true); + // XXX TBD + // if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) + // expect(check1).toBe(true); expect(error).toBeDefined(); expect(error.code).toBeDefined(); expect(error.message).toBeDefined(); @@ -3412,8 +3415,9 @@ var mytests = function() { }, function(error) { // EXPECTED RESULT for (WebKit) Web SQL ONLY: if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--'); - if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) - expect(check1).toBe(true); + // XXX TBD + // if (isWebSql && isAndroid && !(/Android [1-4]/.test(navigator.userAgent))) + // expect(check1).toBe(true); expect(error).toBeDefined(); expect(error.code).toBeDefined(); expect(error.message).toBeDefined(); diff --git a/spec/www/spec/db-tx-error-mapping-test.js b/spec/www/spec/db-tx-error-mapping-test.js index a18f0cda..05b72678 100755 --- a/spec/www/spec/db-tx-error-mapping-test.js +++ b/spec/www/spec/db-tx-error-mapping-test.js @@ -65,13 +65,17 @@ var mytests = function() { // - Android plugin with androidDatabaseImplementation: 2 setting indicates SQLError code 0 // (SQLError.UNKNOWN_ERR) in cases other than a syntax error or constraint violation // - Windows plugin always reports error code 0 (SQLError.UNKNOWN_ERR) and - // INCONSISTENT messages (missing actual error info) + // INCONSISTENT messages (missing actual error info WITH ERROR DESCRIPTION FROM SQLite) + // - In case of default Android evcore-native-driver database access implementation + // error message from sqlite is missing actual error description from SQLite // OTHER ERROR MAPPING NOTES: // // - (WebKit) Web SQL apparently includes 'prepare statement error' vs // 'execute statement error' info along with the sqlite error code - // - Default Android implementation (Android-sqlite-connector) includes + // - XXX TODO NOT INCLUDED BY DEFAULT Android-sqlite-evcore-native-driver-free + // IMPLEMENTATION ON THIS PLUGIN VERSION: + // Default Android implementation (Android-sqlite-connector) includes // sqlite3_prepare_v2 vs sqlite3_step function call info indicating // 'prepare statement error' vs 'execute statement error' // - Android plugin with androidDatabaseImplementation: 2 setting includes the sqlite error code diff --git a/spec/www/spec/db-tx-multiple-update-test.js b/spec/www/spec/db-tx-multiple-update-test.js index 83fe5f44..47ab246e 100755 --- a/spec/www/spec/db-tx-multiple-update-test.js +++ b/spec/www/spec/db-tx-multiple-update-test.js @@ -78,6 +78,8 @@ var mytests = function() { // solved the issue for WP8. // @brodybits noticed similar issue possible with Android-sqlite-connector // if the Android-sqlite-native-driver part is not built correctly. + // (TBD it is suspected but not concluded that this could also be an + // issue on Android-evcore-native-driver if it is not built properly.) test_it(suiteName + 'Multiple updates with key', function () { var db = openDatabase("MultipleUpdatesWithKey", "1.0", "Demo", DEFAULT_SIZE); diff --git a/spec/www/spec/db-tx-sql-features-test.js b/spec/www/spec/db-tx-sql-features-test.js index 07138e3a..1bca8849 100644 --- a/spec/www/spec/db-tx-sql-features-test.js +++ b/spec/www/spec/db-tx-sql-features-test.js @@ -49,7 +49,7 @@ var mytests = function() { // Known to work with: // - iOS 9 Web SQL - // - Android (default Android-sqlite-connector implementation) + // - Android (default Android evcore-native-driver implementation) // - iOS & Windows (with newer sqlite3 build) it(suiteName + 'db readTransaction with a WITH clause', function(done) { if (isWP8) pending('NOT IMPLEMENTED for WP(8)'); @@ -169,7 +169,7 @@ var mytests = function() { it(suiteName + 'Basic JSON1 json test', function(done) { if (isWebSql) pending('SKIP for Web SQL (not implemented)'); - if (!isWebSql && isAndroid && isImpl2) pending('SKIP for androidDatabaseImplementation: 2 [NOT IMPLEMENTED]'); + if (!isWebSql && !isWindows && isAndroid && isImpl2) pending('TBD SKIP for androidDatabaseImplementation: 2'); // XXX TBD var db = openDatabase('basic-json1-json-test.db', '1.0', 'Test', DEFAULT_SIZE); @@ -198,7 +198,7 @@ var mytests = function() { it(suiteName + 'JSON1 json_object test', function(done) { if (isWebSql) pending('SKIP for Web SQL (not implemented)'); - if (!isWebSql && isAndroid && isImpl2) pending('SKIP for androidDatabaseImplementation: 2 [NOT IMPLEMENTED]'); + if (!isWebSql && !isWindows && isAndroid && isImpl2) pending('TBD SKIP for androidDatabaseImplementation: 2'); // XXX TBD var db = openDatabase('json1-json-object-test.db', '1.0', 'Test', DEFAULT_SIZE); @@ -228,7 +228,7 @@ var mytests = function() { it(suiteName + 'create virtual table using FTS5', function(done) { if (isWebSql) pending('SKIP for Web SQL (not implemented)'); - if (!isWebSql && isAndroid && isImpl2) pending('SKIP for androidDatabaseImplementation: 2 [NOT IMPLEMENTED]'); + if (!isWebSql && !isWindows && isAndroid && isImpl2) pending('TBD SKIP for androidDatabaseImplementation: 2'); // XXX TBD var db = openDatabase('virtual-table-using-fts5.db', '1.0', 'Test', DEFAULT_SIZE); diff --git a/spec/www/spec/db-tx-sql-select-value-test.js b/spec/www/spec/db-tx-sql-select-value-test.js index 4e758a6a..5cec6222 100644 --- a/spec/www/spec/db-tx-sql-select-value-test.js +++ b/spec/www/spec/db-tx-sql-select-value-test.js @@ -1831,7 +1831,7 @@ var mytests = function() { it(suiteName + "SELECT X'FFD1FFD2' [TBD BROKEN androidDatabaseImplementation: 2 & Windows; missing result value iOS/macOS]", function(done) { if (isWP8) pending('SKIP for WP8'); - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN: CRASH on Android 5.x (default sqlite-connector version)'); + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN: CRASH on Android 5.x/... (default evcore-native-driver database access implementation)'); var db = openDatabase("Inline-SELECT-BLOB-FFD1FFD2-result-test.db", "1.0", "Demo", DEFAULT_SIZE); diff --git a/spec/www/spec/db-tx-string-test.js b/spec/www/spec/db-tx-string-test.js index da342d0c..7917047f 100755 --- a/spec/www/spec/db-tx-string-test.js +++ b/spec/www/spec/db-tx-string-test.js @@ -442,7 +442,7 @@ var mytests = function() { it(suiteName + "INLINE string vertical tab test", function(done) { if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8) - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN on Android (default evcore-native-driver implementation)'); // [FUTURE TBD (documented)] + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#28 var db = openDatabase("String-vertical-tab-test.db", "1.0", "Demo", DEFAULT_SIZE); expect(db).toBeDefined(); @@ -483,7 +483,7 @@ var mytests = function() { it(suiteName + "INLINE string form feed test", function(done) { if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8) - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN on Android (default evcore-native-driver implementation)'); // [FUTURE TBD (documented)] + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#28 var db = openDatabase("String-form-feed-test.db", "1.0", "Demo", DEFAULT_SIZE); expect(db).toBeDefined(); @@ -524,7 +524,7 @@ var mytests = function() { it(suiteName + "INLINE string backspace test", function(done) { if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8) - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN on Android (default evcore-native-driver implementation)'); // [FUTURE TBD (documented)] + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#28 var db = openDatabase("String-backspace-test.db", "1.0", "Demo", DEFAULT_SIZE); expect(db).toBeDefined(); @@ -593,6 +593,8 @@ var mytests = function() { }, MYTIMEOUT); it(suiteName + 'string parameter value manipulation test with UTF-8 2-octet character é', function(done) { + if (isAndroid && !isWebSql && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#19 + var db = openDatabase("UTF8-2-octet-upper-value-string-test.db", "1.0", "Demo", DEFAULT_SIZE); db.transaction(function(tx) { @@ -648,6 +650,7 @@ var mytests = function() { it(suiteName + 'string parameter value manipulation test with UTF-8 3-octet character €', function(done) { if (isWP8) pending('SKIP for WP(8)'); + if (isAndroid && !isWebSql && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#19 var db = openDatabase("UTF8-3-octet-string-upper-value-test.db", "1.0", "Demo", DEFAULT_SIZE); @@ -671,17 +674,24 @@ var mytests = function() { }); }, MYTIMEOUT); - // TBD NOTE: In case of the default Android database implementation - // (Android-sqlite-connector) it is possible to manipulate, - // store, and retrieve a text string with 4-octet UTF-8 characters such as emojis. - // However HEX manipulations do not work the same as Android/iOS WebKit Web SQL, + // TBD NOTE: In case of the default Android database access + // implementation (evcore-native-driver) it is possible to + // manipulate, store, and retrieve a text string with 4-octet UTF-8 + // characters such as emojis. + // However HEX manipulations _evidently_ do not work the same as Android/iOS WebKit Web SQL, // iOS plugin, or Android plugin with androidDatabaseImplementation : 2 setting. // This linkely indicates that such characters are stored differently [incorrectly] - // due to UTF-8 string handling limitations of Android-sqlite-connector - // and Android-sqlite-native-driver. ref: litehelpers/Cordova-sqlite-storage#564 + // due to UTF-8 string handling limitations of + // evcore-native-driver on Android ref: + // - litehelpers/Cordova-sqlite-evcore-extbuild-free#19 + // - litehelpers/Android-sqlite-evcore-native-driver-free#1 + // - litehelpers/Cordova-sqlite-evcore-extbuild-free#7 (possible crash issue on Android 5.x/...) + // SIMILAR TO: litehelpers/Cordova-sqlite-storage#564 it(suiteName + 'Inline emoji string manipulation test: SELECT UPPER("a\\uD83D\\uDE03.") [\\u1F603 SMILING FACE (MOUTH OPEN)]', function(done) { - var db = openDatabase("Inline-emoji-hex-test.db", "1.0", "Demo", DEFAULT_SIZE); + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX TBD CRASH on Android 7.x/??? (default evcore-native-driver database access implementation)'); + + var db = openDatabase("Inline-emoji-hex-test_1.db", "1.0", "Demo", DEFAULT_SIZE); expect(db).toBeDefined(); db.transaction(function(tx) { @@ -705,8 +715,8 @@ var mytests = function() { }); }, MYTIMEOUT); - it(suiteName + 'Inline emoji HEX test: SELECT HEX("@\\uD83D\\uDE03!") [\\u1F603 SMILING FACE (MOUTH OPEN)] [HEX encoding BUG on Android-sqlite-connector]', function(done) { - var db = openDatabase("Inline-emoji-hex-test.db", "1.0", "Demo", DEFAULT_SIZE); + it(suiteName + 'Inline emoji HEX test: SELECT HEX("@\\uD83D\\uDE03!") [\\u1F603 SMILING FACE (MOUTH OPEN)] [XXX HEX encoding BUG on Android (default evcore-native-driver database access implementation)]', function(done) { + var db = openDatabase("Inline-emoji-hex-test_2.db", "1.0", "Demo", DEFAULT_SIZE); expect(db).toBeDefined(); db.transaction(function(tx) { @@ -717,7 +727,8 @@ var mytests = function() { expect(rs.rows).toBeDefined(); expect(rs.rows.length).toBe(1); - // STOP HERE [HEX encoding BUG] for Android-sqlite-connector: + // STOP HERE [HEX encoding BUG] in case of Android + // (default evcore-native-driver database access implementation) if (!isWebSql && !isWindows && isAndroid && !isImpl2) return done(); if (isWindows) @@ -739,7 +750,7 @@ var mytests = function() { it(suiteName + "Inline BLOB with emoji string manipulation test: SELECT LOWER(X'41F09F9883') [A\uD83D\uDE03] [\\u1F603 SMILING FACE (MOUTH OPEN)]", function(done) { if (isWP8) pending('BROKEN for WP8'); - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN: CRASH on Android 5.x (default sqlite-connector version)'); + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX TBD CRASH on Android 5.x/... (default evcore-native-driver database access implementation)'); if (isWindows) pending('SKIP for Windows'); // FUTURE TBD var db = openDatabase("Inline-emoji-select-lower-result-test.db", "1.0", "Demo", DEFAULT_SIZE); @@ -768,7 +779,7 @@ var mytests = function() { it(suiteName + 'emoji SELECT HEX(?) parameter value test: "@\\uD83D\\uDE03!" [\\u1F603 SMILING FACE (MOUTH OPEN)]', function(done) { if (isWP8) pending('BROKEN for WP8'); - if (isAndroid && !isWebSql && !isImpl2) pending('BROKEN for Android (default sqlite-connector version)'); + if (isAndroid && !isWebSql && !isImpl2) pending('BROKEN on Android (default evcore-native-driver database access implementation)'); var db = openDatabase("String-emoji-parameter-value-test.db", "1.0", "Demo", DEFAULT_SIZE); expect(db).toBeDefined(); @@ -993,6 +1004,7 @@ var mytests = function() { it(suiteName + 'Inline string manipulation test with UTF-8 2/3 octet characters', function(done) { if (isWP8) pending('SKIP for WP(8)'); + if (isAndroid && !isWebSql && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#19 var db = openDatabase("Inline-UTF8-string-manipulation-test.db", "1.0", "Demo", DEFAULT_SIZE); @@ -1021,6 +1033,7 @@ var mytests = function() { it(suiteName + 'string parameter manipulation test with UTF-8 2/3 octet characters', function(done) { if (isWP8) pending('SKIP for WP(8)'); + if (isAndroid && !isWebSql && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#19 var db = openDatabase("UTF8-string-parameter-manipulation-test.db", "1.0", "Demo", DEFAULT_SIZE); diff --git a/spec/www/spec/db-tx-value-bindings-test.js b/spec/www/spec/db-tx-value-bindings-test.js index e67e9e2c..cad0c5cd 100755 --- a/spec/www/spec/db-tx-value-bindings-test.js +++ b/spec/www/spec/db-tx-value-bindings-test.js @@ -105,6 +105,8 @@ var mytests = function() { }, MYTIMEOUT); it(suiteName + 'INSERT TEXT string with é (UTF-8 2 octets), SELECT the data, check, and check HEX value [UTF-16le on Windows]', function(done) { + if (isAndroid && !isWebSql && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#19 + var db = openDatabase('INSERT-UTF8-2-octets-and-check.db', '1.0', 'Demo', DEFAULT_SIZE); db.transaction(function(tx) { @@ -144,6 +146,8 @@ var mytests = function() { }, MYTIMEOUT); it(suiteName + 'INSERT TEXT string with € (UTF-8 3 octets), SELECT the data, check, and check HEX value [UTF-16le on Windows]', function(done) { + if (isAndroid && !isWebSql && !isImpl2) pending('XXX SKIP: BUG on Android (default Android-sqlite-evcore-native-driver access implementation)'); // XXX ref: litehelpers/Cordova-sqlite-evcore-extbuild-free#19 + var db = openDatabase('INSERT-UTF8-3-octets-and-check.db', '1.0', 'Demo', DEFAULT_SIZE); db.transaction(function(tx) { @@ -518,9 +522,16 @@ var mytests = function() { }); }, MYTIMEOUT); - // NOTE: emojis and other 4-octet UTF-8 characters apparently not stored - // properly by Android-sqlite-connector ref: litehelpers/Cordova-sqlite-storage#564 - it(suiteName + 'INSERT TEXT string with emoji [\\u1F603 SMILING FACE (MOUTH OPEN)], SELECT the data, check, and check HEX [UTF-16le on Windows; HEX encoding BUG on Android-sqlite-connector]' , function(done) { + // NOTE: emojis and other 4-octet UTF-8 characters _evidently_ not stored + // properly by Android-sqlite-connector / Android evcore-native-driver + // ref: + // - litehelpers/Cordova-sqlite-storage#564 + // - litehelpers/Cordova-sqlite-evcore-extbuild-free#19 + // - litehelpers/Android-sqlite-evcore-native-driver-free#1 + // - litehelpers/Cordova-sqlite-evcore-extbuild-free#7 (possible crash issue on Android 5.x/...) + it(suiteName + 'INSERT TEXT string with emoji [\\u1F603 SMILING FACE (MOUTH OPEN)], SELECT the data, check, and check HEX [UTF-16le on Windows]' , function(done) { + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX TBD CRASH on Android 7.x/??? (default evcore-native-driver database access implementation)'); + var db = openDatabase('INSERT-emoji-and-check.db', '1.0', 'Demo', DEFAULT_SIZE); db.transaction(function(tx) { @@ -547,8 +558,12 @@ var mytests = function() { expect(rs3.rows).toBeDefined(); expect(rs3.rows.length).toBe(1); - // STOP HERE [HEX encoding BUG] for Android-sqlite-connector: - if (!isWebSql && !isWindows && isAndroid && !isImpl2) return done(); + // TBD NOT APPLICABLE in this plugin version + // (TEST SKIPPPED for default evcore-native-driver database + // access implementation due to possible crash on + // Android 7.x/???): + // STOP HERE [HEX encoding BUG] for XXX TBD + // if (!isWebSql && !isWindows && isAndroid && !isImpl2) return done(); if (isWindows) expect(rs3.rows.item(0).hexvalue).toBe('40003DD803DE2100'); // (UTF-16le) @@ -1254,10 +1269,10 @@ var mytests = function() { describe(scenarioList[i] + ': special UNICODE column value binding test(s)', function() { - it(suiteName + ' stores [Unicode] string with \\u0000 (same as \\0) correctly [HEX encoding check BROKEN for Android-sqlite-connector]', function (done) { - if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8) - if (isWindows) pending('BROKEN on Windows'); // TBD (truncates on Windows) - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN on Android (default evcore-native-driver implementation)'); // [FUTURE TBD (documented)] + it(suiteName + ' stores [Unicode] string with \\u0000 (same as \\0) correctly [XXX TBD NOT SUPPORTED ON ALL PLATFORMS]', function (done) { + // if (isWP8) pending(...); // XXX WP8 NOT SUPPORTED by this plugin version + if (isWindows) pending('XXX SKIP DUE TO TRUNCATION ISSUE on Windows'); // XXX TBD + if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('XXX TBD BROKEN on default Android evcore-native-driver database access implementation'); // XXX TBD var db = openDatabase('UNICODE-store-u0000-test.db'); @@ -1310,11 +1325,10 @@ var mytests = function() { }); }, MYTIMEOUT); - it(suiteName + ' returns [Unicode] string with \\u0000 (same as \\0) correctly [BROKEN: TRUNCATES on Windows]', function (done) { + it(suiteName + ' returns [Unicode] string with \\u0000 (same as \\0) correctly [XXX BUG on Android & Windows: TRUNCATION on Windows; INCORRECT VALUE on Android (default evcore-native-driver database access implementation)]', function (done) { if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8) - if (!isWebSql && !isWindows && isAndroid && !isImpl2) pending('BROKEN on Android (default evcore-native-driver implementation)'); // [FUTURE TBD (documented)] - if (isWindows) pending('BROKEN on Windows'); // XXX - // if (isWebSql && isAndroid) pending('SKIP on Android Web SQL'); // XXX TBD - POSSIBLY INCONSISTENT RESULTS Android 4 vs 5 ??? + if (isWebSql && isAndroid) pending('XXX BROKEN on Android (default evcore-native-driver implementation') // XXX TBD ... + // if (isWindows) pending('...'); // XXX REPRODUCE TRUNCATION BUG ON Windows var db = openDatabase('UNICODE-retrieve-u0000-test.db'); @@ -1335,9 +1349,21 @@ var mytests = function() { // we would like to know, so the test is coded to fail if it starts // working there. - if (isWindows || (isWebSql && !(/Android [5-9]/.test(navigator.userAgent)))) { + //* if (isWindows || (isWebSql && !(/Android [5-9]/.test(navigator.userAgent)))) { + //* expect(name.length).toBe(1); + //* expect(name).toBe('a'); + //* } // else ... + if (isWebSql) { + expect(name.length).toBe(1); + expect(name).toBe('a'); + } else if (isWindows) { + // XXX BUG on Windows: expect(name.length).toBe(1); expect(name).toBe('a'); + } else if (!isWindows && isAndroid && !isImpl2) { + // XXX BUG on Android (default evcore-native-driver database access implementation): + expect(name.length).toBe(7); + expect(name).toBe('a0000cd'); } else { expect(name.length).toBe(4); expect(name).toBe('a\u0000cd'); diff --git a/spec/www/spec/regexp-test.js b/spec/www/spec/regexp-test.js index 6634b02d..5bbb0395 100644 --- a/spec/www/spec/regexp-test.js +++ b/spec/www/spec/regexp-test.js @@ -42,7 +42,8 @@ var mytests = function() { function(done) { if (isWP8) pending('NOT IMPLEMENTED for WP8 (plugin)'); if (isWindows) pending('NOT IMPLEMENTED for Windows (plugin)'); - if (!isWebSql && isAndroid && isImpl2 && /Android [1-4]/.test(navigator.userAgent)) pending('BROKEN for android.database (version 1.x-4.x)'); + // if (!isWebSql && isAndroid && isImpl2 && /Android [1-4]/.test(navigator.userAgent)) pending('BROKEN for android.database (version 1.x-4.x)'); + if (!isWebSql && !isWindows && isAndroid && isImpl2) pending('TBD SKIP for androidDatabaseImplementation: 2'); // XXX TBD (Android 4.x vs 5.x vs ...) if (isWebSql && !isAndroid && !isWindows && !isWP8) pending('SKIP for iOS (WebKit) Web SQL'); var db = openDatabase('simple-regexp-test.db', '1.0', 'test', DEFAULT_SIZE); diff --git a/src/android/io/sqlc/SQLitePlugin.java b/src/android/io/sqlc/SQLitePlugin.java index bca5480a..3c71c694 100755 --- a/src/android/io/sqlc/SQLitePlugin.java +++ b/src/android/io/sqlc/SQLitePlugin.java @@ -39,14 +39,15 @@ public class SQLitePlugin extends CordovaPlugin { /** - * Multiple database runner map (static). + * Multiple database runner lookup maps (static). * - * NOTE: no public static accessor to db (runner) map since it is not + * NOTE: no public static accessor to db runner maps since it is not * expected to work properly with db threading. * * FUTURE TBD put DBRunner into a public class that can provide external accessor. * - * ADDITIONAL NOTE: Storing as Map to avoid portabiity issue + * ADDITIONAL NOTE: Storing as Map and + * Map to avoid portabiity issue * between Java 6/7/8 as discussed in: * https://gist.github.com/AlainODea/1375759b8720a3f9f094 * @@ -54,7 +55,6 @@ public class SQLitePlugin extends CordovaPlugin { * https://github.com/litehelpers/Cordova-sqlite-storage/issues/727 */ static Map dbrmap = new ConcurrentHashMap(); - // static ConcurrentHashMap dbrmap2 = new ConcurrentHashMap(); static Map dbrmap2 = new ConcurrentHashMap(); static int lastdbid = 0; diff --git a/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems b/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems index e67ad2a7..9e8139bb 100644 --- a/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems +++ b/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Shared.vcxitems @@ -11,7 +11,7 @@ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(MSBuildThisFileDirectory)..\..\..\deps\common;$(MSBuildThisFileDirectory)..\..\..\deps\common\sqlite3-base64;$(MSBuildThisFileDirectory)..\..\..\deps\common\libb64-encode - /DSQLITE_TEMP_STORE=2 /DSQLITE_THREADSAFE=1 /DSQLITE_ENABLE_FTS3 /DSQLITE_ENABLE_FTS3_PARENTHESIS /DSQLITE_ENABLE_FTS4 /DSQLITE_ENABLE_FTS5 /DSQLITE_ENABLE_RTREE /DSQLITE_ENABLE_JSON1 /DSQLITE_OMIT_BUILTIN_TEST /DSQLITE_OMIT_LOAD_EXTENSION /DSQLITE_DEFAULT_PAGE_SIZE=4096 /DSQLITE_DEFAULT_CACHE_SIZE=-2000 /DSQLITE_OS_WINRT %(AdditionalOptions) + /DSQLITE_THREADSAFE=1 /DHAVE_USLEEP=1 /DSQLITE_DEFAULT_MEMSTATUS=0 /DSQLITE_OMIT_DECLTYPE /DSQLITE_OMIT_DEPRECATED /DSQLITE_OMIT_PROGRESS_CALLBACK /DSQLITE_OMIT_SHARED_CACHE /DSQLITE_TEMP_STORE=2 /DSQLITE_OMIT_LOAD_EXTENSION /DSQLITE_ENABLE_FTS3 /DSQLITE_ENABLE_FTS3_PARENTHESIS /DSQLITE_ENABLE_FTS4 /DSQLITE_ENABLE_FTS5 /DSQLITE_ENABLE_RTREE /DSQLITE_ENABLE_JSON1 /DSQLITE_DEFAULT_PAGE_SIZE=4096 /DSQLITE_DEFAULT_CACHE_SIZE=-2000 /DSQLITE_OS_WINRT %(AdditionalOptions) diff --git a/www/SQLitePlugin.js b/www/SQLitePlugin.js index cf4bfed0..5157b659 100644 --- a/www/SQLitePlugin.js +++ b/www/SQLitePlugin.js @@ -1,6 +1,6 @@ /* License for this version: GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license. -Contact for commercial license: info@litehelpers.net +Contact for commercial license: sales@litehelpers.net */ (function() {