aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/batch-runner.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-30 15:24:58 +0000
committerstephan <stephan@noemail.net>2022-09-30 15:24:58 +0000
commit359d62395ec5423b5ac906dd9fda300d679d34b7 (patch)
treef31f70ca7d803b42e392c766c3e1825196b337ae /ext/wasm/batch-runner.js
parentdc6ae60226accb043be78771d2033ba34cad3bbe (diff)
downloadsqlite-359d62395ec5423b5ac906dd9fda300d679d34b7.tar.gz
sqlite-359d62395ec5423b5ac906dd9fda300d679d34b7.zip
batch-runner.js: force WebSQL batches to not abort for a failed statement (necessary for apples-to-apples-ish benchmark comparisons).
FossilOrigin-Name: 60f0c5cb04d2baf8431e523434d8753e39377f4b2c6bad225c2e5487a4be419b
Diffstat (limited to 'ext/wasm/batch-runner.js')
-rw-r--r--ext/wasm/batch-runner.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/wasm/batch-runner.js b/ext/wasm/batch-runner.js
index ad281c2e9..36083e62f 100644
--- a/ext/wasm/batch-runner.js
+++ b/ext/wasm/batch-runner.js
@@ -184,6 +184,7 @@
let runner;
if('websql'===db.id){
+ const who = this;
runner = function(resolve, reject){
/* WebSQL cannot execute multiple statements, nor can it execute SQL without
an explicit transaction. Thus we have to do some fragile surgery on the
@@ -217,7 +218,8 @@
tx.executeSql(s,[], ()=>{}, (t,e)=>{
console.error("WebSQL error",e,"SQL =",s);
who.logErr(e.message);
- throw e;
+ //throw e;
+ return false;
});
metrics.stepTotal += performance.now() - t;
}
@@ -230,7 +232,11 @@
const nextBatch = function(){
if(sqls.length){
console.log("websql sqls.length",sqls.length,'of',n);
- db.handle.transaction(transaction, reject, nextBatch);
+ db.handle.transaction(transaction, (e)=>{
+ who.logErr("Ignoring and contiuing:",e.message)
+ //reject(e);
+ return false;
+ }, nextBatch);
}else{
resolve(who);
}
@@ -240,7 +246,8 @@
}catch(e){
//this.gotErr = e;
console.error("websql error:",e);
- reject(e);
+ who.logErr(e.message);
+ //reject(e);
}
}.bind(this);
}else{/*sqlite3 db...*/
@@ -292,6 +299,7 @@
//this.gotErr = e;
reject(e);
}finally{
+ capi.sqlite3_exec(db.handle,"rollback;",0,0,0);
wasm.scopedAllocPop(stack);
}
}.bind(this);
@@ -604,7 +612,8 @@
}/*run()*/
}/*App*/;
- self.sqlite3TestModule.initSqlite3().then(function(sqlite3){
+ self.sqlite3TestModule.initSqlite3().then(function(sqlite3_){
+ sqlite3 = sqlite3_;
self.App = App /* only to facilitate dev console access */;
App.run(sqlite3);
});