aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-oo1.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-08-29 08:04:55 +0000
committerstephan <stephan@noemail.net>2022-08-29 08:04:55 +0000
commitd7d1098baa959ac5c24f69fa57299f161891b59f (patch)
tree8b69d6c962cd6bc5c0031dc7016f663cb688eedf /ext/wasm/api/sqlite3-api-oo1.js
parenta3825e78bdcaaac7681b68a0efc3cd9a253ce9b5 (diff)
downloadsqlite-d7d1098baa959ac5c24f69fa57299f161891b59f.tar.gz
sqlite-d7d1098baa959ac5c24f69fa57299f161891b59f.zip
oo #1 api: correct a case where a null callback is called. Rename some vars for clarity. Increase wasm-side memory in order to be able to load the speedtest1 output.
FossilOrigin-Name: b5058f14fadbc8a1886f27cff08593dd2c8e2b2cb6d7bed3b8733a55f031989f
Diffstat (limited to 'ext/wasm/api/sqlite3-api-oo1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-oo1.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-api-oo1.js b/ext/wasm/api/sqlite3-api-oo1.js
index c2b060137..6317f97f5 100644
--- a/ext/wasm/api/sqlite3-api-oo1.js
+++ b/ext/wasm/api/sqlite3-api-oo1.js
@@ -521,7 +521,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
? opt.rowMode : undefined);
let stmt;
let bind = opt.bind;
- let doneFirstQuery = false/*true once we handle a result-returning query*/;
+ let runFirstQuery = !!(arg.cbArg || opt.columnNames) /* true to evaluate the first result-returning query */;
const stack = wasm.scopedAllocPush();
try{
const isTA = util.isSQLableTypedArray(arg.sql)
@@ -565,14 +565,14 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
stmt.bind(bind);
bind = null;
}
- if(!doneFirstQuery && stmt.columnCount){
+ if(runFirstQuery && stmt.columnCount){
/* Only forward SELECT results for the FIRST query
in the SQL which potentially has them. */
- doneFirstQuery = true;
+ runFirstQuery = false;
if(Array.isArray(opt.columnNames)){
stmt.getColumnNames(opt.columnNames);
}
- while(stmt.step()){
+ while(!!arg.cbArg && stmt.step()){
stmt._isLocked = true;
const row = arg.cbArg(stmt);
if(resultRows) resultRows.push(row);