Skip to content

Commit

Permalink
cordova-sqlite-evcore-extbuild-free 0.9.2 - merge release
Browse files Browse the repository at this point in the history
Merge branch 'storage-master'

(With additional doc updates. Also SQLite compile-time definition
updates from cordova-sqlite-storage are ignored in this merge.)
  • Loading branch information
Christopher J. Brody committed Jan 17, 2018
2 parents a0e2601 + 7d76164 commit 4d94a8f
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 59 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changes

# cordova-sqlite-evcore-extbuild-free 0.9.2

## cordova-sqlite-storage 2.2.0

- Fix SQLiteAndroidDatabase implementation for Turkish and other foreign locales

## cordova-sqlite-storage 2.1.0

- Visual Studio 2017 updates for Windows UWP build

# cordova-sqlite-evcore-extbuild-free 0.9.1

- cordova-sqlite-evcore-common-free compile-time option fixes for iOS/macOS:
Expand Down
43 changes: 28 additions & 15 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-sqlite-evcore-extbuild-free",
"version": "0.9.1",
"version": "0.9.2",
"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",
Expand Down
5 changes: 2 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-sqlite-evcore-extbuild-free"
version="0.9.1">
version="0.9.2">

<name>Cordova sqlite storage - free enterprise version with Android performance/memory improvements and extra features for PhoneGap Build</name>

Expand Down Expand Up @@ -78,7 +78,7 @@
</feature>
</config-file>

<!-- Note: the macOS src is based off src/ios implicitly -->
<!-- Note: the macOS (osx) src is based off src/ios implicitly -->
<header-file src="src/ios/SQLitePlugin.h" />
<source-file src="src/ios/SQLitePlugin.m" />

Expand All @@ -100,7 +100,6 @@
<header-file src="src/deps/common/sqlite3.h" />
<source-file src="src/deps/common/sqlite3.c"
compiler-flags="-w -DSQLITE_TEMP_STORE=2 -DSQLITE_THREADSAFE=2 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DEFAULT_PAGE_SIZE=4096 -DSQLITE_DEFAULT_CACHE_SIZE=-2000" />
-->
</platform>

<!-- windows -->
Expand Down
64 changes: 44 additions & 20 deletions spec/www/spec/db-tx-error-handling-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,8 @@ var mytests = function() {
it(suiteName + 'Inline US-ASCII blank string test with arguments array=function (BOGUS) in a try-catch block [TBD (WebKit) Web SQL vs plugin]', function(done) {
var db = openDatabase("Inline-US-ASCII-string-test-with-arguments-array-equals-function.db", "1.0", "Demo", DEFAULT_SIZE);

if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
// if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
var check1 = false;
db.transaction(function(transaction) {
try {
transaction.executeSql("SELECT ''", function(ignored1, ignored2) {
Expand All @@ -3230,22 +3231,27 @@ var mytests = function() {
return true;
});
} catch(ex) {
// NOT EXPECTED for (WebKit) Web SQL or plugin:
expect(false).toBe(true);
// EXPECTED RESULT for (WebKit) Web SQL ONLY:
if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--');
if (isWebSql && !isAndroid) expect('iOS WebKit Web SQL behavior changed').toBe('--');
check1 = true;
expect(ex).toBeDefined();
expect(ex.code).toBeDefined();
// expect(ex.code).toBeDefined();
expect(ex.message).toBeDefined();
throw ex;
}

}, 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);
expect(error).toBeDefined();
expect(error.code).toBeDefined();
expect(error.message).toBeDefined();
expect(error.code).toBe(0);
expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);
// TBD ???:
// expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);

// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
Expand All @@ -3261,7 +3267,8 @@ var mytests = function() {
it(suiteName + 'Inline US-ASCII blank string test with arguments array=function (BOGUS) in a try-catch block read tx [TBD (WebKit) Web SQL vs plugin]', function(done) {
var db = openDatabase("Inline-US-ASCII-string-test-with-arguments-array-equals-function-read-tx.db", "1.0", "Demo", DEFAULT_SIZE);

if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
// if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
var check1 = false;
db.readTransaction(function(readTransaction) {
try {
readTransaction.executeSql("SELECT ''", function(ignored1, ignored2) {
Expand All @@ -3280,22 +3287,27 @@ var mytests = function() {
return true;
});
} catch(ex) {
// NOT EXPECTED for (WebKit) Web SQL or plugin:
expect(false).toBe(true);
// EXPECTED RESULT for (WebKit) Web SQL ONLY:
if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--');
if (isWebSql && !isAndroid) expect('iOS WebKit Web SQL behavior changed').toBe('--');
check1 = true;
expect(ex).toBeDefined();
expect(ex.code).toBeDefined();
// expect(ex.code).toBeDefined();
expect(ex.message).toBeDefined();
throw ex;
}

}, 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);
expect(error).toBeDefined();
expect(error.code).toBeDefined();
expect(error.message).toBeDefined();
expect(error.code).toBe(0);
expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);
// TBD ???:
// expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);

// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
Expand All @@ -3311,7 +3323,8 @@ var mytests = function() {
it(suiteName + 'SELECT ? test with arguments array=function (BOGUS) in a try-catch block [TBD (WebKit) Web SQL vs plugin]', function(done) {
var db = openDatabase("SELECT-parameter-with-arguments-array-equals-function.db", "1.0", "Demo", DEFAULT_SIZE);

if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
// if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
var check1 = false;
db.transaction(function(transaction) {
try {
transaction.executeSql("SELECT ?", function(ignored1, ignored2) {
Expand All @@ -3330,22 +3343,27 @@ var mytests = function() {
return true;
});
} catch(ex) {
// NOT EXPECTED for (WebKit) Web SQL or plugin:
expect(false).toBe(true);
// EXPECTED RESULT for (WebKit) Web SQL ONLY:
if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--');
if (isWebSql && !isAndroid) expect('iOS WebKit Web SQL behavior changed').toBe('--');
check1 = true;
expect(ex).toBeDefined();
expect(ex.code).toBeDefined();
// expect(ex.code).toBeDefined();
expect(ex.message).toBeDefined();
throw ex;
}

}, 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);
expect(error).toBeDefined();
expect(error.code).toBeDefined();
expect(error.message).toBeDefined();
expect(error.code).toBe(0);
expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);
// TBD ???:
// expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);

// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
Expand All @@ -3361,7 +3379,8 @@ var mytests = function() {
it(suiteName + 'SELECT ? test with arguments array=function (BOGUS) in a try-catch block read tx [TBD (WebKit) Web SQL vs plugin]', function(done) {
var db = openDatabase("SELECT-parameter-with-arguments-array-equals-function-read-tx.db", "1.0", "Demo", DEFAULT_SIZE);

if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
// if (isWebSql) pending('SKIP for (WebKit) Web SQL'); // XXX TBD SKIP FOR NOW on (WebKit) Web SQL
var check1 = false;
db.readTransaction(function(transaction) {
try {
transaction.executeSql("SELECT ?", function(ignored1, ignored2) {
Expand All @@ -3380,22 +3399,27 @@ var mytests = function() {
return true;
});
} catch(ex) {
// NOT EXPECTED for (WebKit) Web SQL or plugin:
expect(false).toBe(true);
// EXPECTED RESULT for (WebKit) Web SQL ONLY:
if (!isWebSql) expect('Plugin BEHAVIOR CHANGED, please update this test').toBe('--');
if (isWebSql && !isAndroid) expect('iOS WebKit Web SQL behavior changed').toBe('--');
check1 = true;
expect(ex).toBeDefined();
expect(ex.code).toBeDefined();
// expect(ex.code).toBeDefined();
expect(ex.message).toBeDefined();
throw ex;
}

}, 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);
expect(error).toBeDefined();
expect(error.code).toBeDefined();
expect(error.message).toBeDefined();
expect(error.code).toBe(0);
expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);
// TBD ???:
// expect(error.message).toMatch(/callback raised an exception.*or.*error callback did not return false/);

// Close (plugin only) & finish:
(isWebSql) ? done() : db.close(done, done);
Expand Down
8 changes: 3 additions & 5 deletions spec/www/spec/db-tx-value-bindings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1312,8 +1312,9 @@ var mytests = function() {

it(suiteName + ' returns [Unicode] string with \\u0000 (same as \\0) correctly [BROKEN: TRUNCATES on Windows]', function (done) {
if (isWP8) pending('BROKEN on WP(8)'); // [BUG #202] UNICODE characters not working with WP(8)
if (isWebSql && isAndroid) pending('SKIP for Android (WebKit Web SQL)') // XXX TBD ...
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 ???

var db = openDatabase('UNICODE-retrieve-u0000-test.db');

Expand All @@ -1334,10 +1335,7 @@ var mytests = function() {
// we would like to know, so the test is coded to fail if it starts
// working there.

if (isWebSql) {
expect(name.length).toBe(1);
expect(name).toBe('a');
} else if (isWindows) {
if (isWindows || (isWebSql && !(/Android [5-9]/.test(navigator.userAgent)))) {
expect(name.length).toBe(1);
expect(name).toBe('a');
} else {
Expand Down
9 changes: 6 additions & 3 deletions spec/www/spec/sqlite-version-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ var mytests = function() {
expect(rs).toBeDefined();
expect(rs.rows).toBeDefined();
expect(rs.rows.length).toBe(1);
// TBD different for builtin android.database implementation:
if (!isWindows && isAndroid && isImpl2) // TBD ...
expect(rs.rows.item(0).journal_mode).toBeDefined(); // XXX TODO
// DEFAULT PRAGMA journal_mode setting is
// DIFFERENT for builtin android.database implementation:
if (!isWindows && isAndroid && isImpl2)
expect(rs.rows.item(0).journal_mode).toBe(
(/Android [2-7]/.test(navigator.userAgent)) ?
'persist' : 'truncate');
else
expect(rs.rows.item(0).journal_mode).toBe('delete');

Expand Down
4 changes: 3 additions & 1 deletion src/android/io/sqlc/SQLiteAndroidDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.lang.IllegalArgumentException;
import java.lang.Number;

import java.util.Locale;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -549,7 +551,7 @@ static QueryType getQueryType(String query) {
// (needed for SQLCipher version)
if (first.length() == 0) throw new RuntimeException("query not found");

return QueryType.valueOf(first.toLowerCase());
return QueryType.valueOf(first.toLowerCase(Locale.ENGLISH));
} catch (IllegalArgumentException ignore) {
// unknown verb (NOT blank)
return QueryType.other;
Expand Down
5 changes: 4 additions & 1 deletion src/ios/SQLitePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ -(void)openNow: (CDVInvokedUrlCommand*)command
NSString *dbname = [self getDBPath:dbfilename at:dblocation];

if (dbname == NULL) {
// XXX NOT EXPECTED (INTERNAL ERROR):
// XXX NOT EXPECTED (INTERNAL ERROR - XXX TODO SIGNAL ERROR STATUS):
// NSLog(@"No db name specified for open");
// DLog(@"No db name specified for open");
NSLog(@"No db name specified for open");
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"You must specify database name"];
}
Expand All @@ -130,6 +132,7 @@ -(void)openNow: (CDVInvokedUrlCommand*)command

if (dbPointer != NULL) {
// NO LONGER EXPECTED due to BUG 666 workaround solution:
// DLog(@"Reusing existing database connection for db name %@", dbfilename);
NSLog(@"INTERNAL ERROR: database already open for db name: %@ (db file name: %@)", dbname, dbfilename);
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString: @"INTERNAL ERROR: database already open"];
[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
Expand Down
Loading

0 comments on commit 4d94a8f

Please sign in to comment.