-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PARTIALLY Revert "Workaround solution to BUG storesafe/cordova-sqlite…
…-storage#666" PARTIALLY reverts commit a760cc6. (REMOVED OLD WORKAROUND SOLUTION to BUG 666; new workaround solution also not wanted.)
- Loading branch information
Christopher J. Brody
committed
Feb 4, 2018
1 parent
50600d3
commit 8ed1caf
Showing
7 changed files
with
130 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* | ||
License for this version: GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license. | ||
Contact for commercial license: [email protected] | ||
|
@@ -249,28 +248,19 @@ Contact for commercial license: [email protected] | |
}; | ||
})(this); | ||
this.openDBs[this.dbname] = DB_STATE_INIT; | ||
nextTick((function(_this) { | ||
return function() { | ||
var myfn; | ||
if (!txLocks[_this.dbname]) { | ||
myfn = function(tx) { | ||
tx.addStatement('ROLLBACK'); | ||
}; | ||
_this.addTransaction(new SQLitePluginTransaction(_this, myfn, null, null, false, false)); | ||
} | ||
if (isWorker) { | ||
return aqrequest('sq', 'open', encodeURIComponent(JSON.stringify([_this.openargs])), function(s) { | ||
if (s === 'a1') { | ||
return opensuccesscb(s); | ||
} else { | ||
return openerrorcb(); | ||
} | ||
}); | ||
} else { | ||
return root.sqlitePluginHelper.exec('open', [_this.openargs], opensuccesscb, openerrorcb); | ||
} | ||
}; | ||
})(this)); | ||
if (true) { | ||
if (isWorker) { | ||
aqrequest('sq', 'open', encodeURIComponent(JSON.stringify([this.openargs])), function(s) { | ||
if (s === 'a1') { | ||
return opensuccesscb(s); | ||
} else { | ||
return openerrorcb(); | ||
} | ||
}); | ||
} else { | ||
root.sqlitePluginHelper.exec('open', [this.openargs], opensuccesscb, openerrorcb); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
|
@@ -909,20 +899,29 @@ Contact for commercial license: [email protected] | |
location: 'default' | ||
}, function(db) { | ||
db.transaction(function(tx) { | ||
tx.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) { | ||
if (!resutSet.rows) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows'); | ||
} | ||
if (!resutSet.rows.length) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length'); | ||
} | ||
if (resutSet.rows.length !== 1) { | ||
return SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.length value: " + resutSet.rows.length + " (expected: 1)"); | ||
} | ||
SelfTest.step3(successcb, errorcb); | ||
}); | ||
tx.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) {}); | ||
}, function(txError) { | ||
return SelfTest.finishWithError(errorcb, "UNEXPECTED TRANSACTION ERROR: " + txError); | ||
if (!txError) { | ||
return SelfTest.finishWithError(errorcb, 'Missing txError object'); | ||
} | ||
db.transaction(function(tx2) { | ||
tx2.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) { | ||
if (!resutSet.rows) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows'); | ||
} | ||
if (!resutSet.rows.length) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length'); | ||
} | ||
if (resutSet.rows.length !== 1) { | ||
return SelfTest.finishWithError(errorcb); | ||
} | ||
SelfTest.step3(successcb, errorcb); | ||
}); | ||
}, function(tx2_err) { | ||
return SelfTest.finishWithError(errorcb, "UNEXPECTED TRANSACTION ERROR: " + tx2_err); | ||
}); | ||
}, function() { | ||
return SelfTest.finishWithError(errorcb, 'UNEXPECTED SUCCESS ref: litehelpers/Cordova-sqlite-storage#666'); | ||
}); | ||
}, function(open_err) { | ||
return SelfTest.finishWithError(errorcb, "Open database error: " + open_err); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* | ||
License for this version: GPL v3 (http://www.gnu.org/licenses/gpl.txt) or commercial license. | ||
Contact for commercial license: [email protected] | ||
|
@@ -249,28 +248,19 @@ Contact for commercial license: [email protected] | |
}; | ||
})(this); | ||
this.openDBs[this.dbname] = DB_STATE_INIT; | ||
nextTick((function(_this) { | ||
return function() { | ||
var myfn; | ||
if (!txLocks[_this.dbname]) { | ||
myfn = function(tx) { | ||
tx.addStatement('ROLLBACK'); | ||
}; | ||
_this.addTransaction(new SQLitePluginTransaction(_this, myfn, null, null, false, false)); | ||
} | ||
if (isWorker) { | ||
return aqrequest('sq', 'open', encodeURIComponent(JSON.stringify([_this.openargs])), function(s) { | ||
if (s === 'a1') { | ||
return opensuccesscb(s); | ||
} else { | ||
return openerrorcb(); | ||
} | ||
}); | ||
} else { | ||
return root.sqlitePluginHelper.exec('open', [_this.openargs], opensuccesscb, openerrorcb); | ||
} | ||
}; | ||
})(this)); | ||
if (true) { | ||
if (isWorker) { | ||
aqrequest('sq', 'open', encodeURIComponent(JSON.stringify([this.openargs])), function(s) { | ||
if (s === 'a1') { | ||
return opensuccesscb(s); | ||
} else { | ||
return openerrorcb(); | ||
} | ||
}); | ||
} else { | ||
root.sqlitePluginHelper.exec('open', [this.openargs], opensuccesscb, openerrorcb); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
|
@@ -909,20 +899,29 @@ Contact for commercial license: [email protected] | |
location: 'default' | ||
}, function(db) { | ||
db.transaction(function(tx) { | ||
tx.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) { | ||
if (!resutSet.rows) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows'); | ||
} | ||
if (!resutSet.rows.length) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length'); | ||
} | ||
if (resutSet.rows.length !== 1) { | ||
return SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.length value: " + resutSet.rows.length + " (expected: 1)"); | ||
} | ||
SelfTest.step3(successcb, errorcb); | ||
}); | ||
tx.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) {}); | ||
}, function(txError) { | ||
return SelfTest.finishWithError(errorcb, "UNEXPECTED TRANSACTION ERROR: " + txError); | ||
if (!txError) { | ||
return SelfTest.finishWithError(errorcb, 'Missing txError object'); | ||
} | ||
db.transaction(function(tx2) { | ||
tx2.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) { | ||
if (!resutSet.rows) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows'); | ||
} | ||
if (!resutSet.rows.length) { | ||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length'); | ||
} | ||
if (resutSet.rows.length !== 1) { | ||
return SelfTest.finishWithError(errorcb); | ||
} | ||
SelfTest.step3(successcb, errorcb); | ||
}); | ||
}, function(tx2_err) { | ||
return SelfTest.finishWithError(errorcb, "UNEXPECTED TRANSACTION ERROR: " + tx2_err); | ||
}); | ||
}, function() { | ||
return SelfTest.finishWithError(errorcb, 'UNEXPECTED SUCCESS ref: litehelpers/Cordova-sqlite-storage#666'); | ||
}); | ||
}, function(open_err) { | ||
return SelfTest.finishWithError(errorcb, "Open database error: " + open_err); | ||
|