1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

If sqlite3.oo1.DB.exec()'s callback returns a literal false, stop step()ing over results as if the end of the result set had been reached. Unrelated minor code-adjacent cleanups.

FossilOrigin-Name: 33a58c8ece3b37a8edc3434af36643e2d489a53a672d778c5b77e66666045c30
This commit is contained in:
stephan
2022-12-24 01:59:42 +00:00
parent 027afccdcd
commit 0cdc01d01a
4 changed files with 46 additions and 23 deletions

View File

@@ -1391,6 +1391,14 @@ self.sqlite3InitModule = sqlite3InitModule;
db.selectValue("SELECT "+Number.MIN_SAFE_INTEGER)).
assert(Number.MAX_SAFE_INTEGER ===
db.selectValue("SELECT "+Number.MAX_SAFE_INTEGER));
counter = 0;
db.exec({
sql: "SELECT a FROM t",
callback: ()=>(1===++counter),
});
T.assert(2===counter,
"Expecting exec step() loop to stop if callback returns false.");
if(wasm.bigIntEnabled && haveWasmCTests()){
const mI = wasm.xCall('sqlite3_wasm_test_int64_max');
const b = BigInt(Number.MAX_SAFE_INTEGER * 2);