}/*sqlite3_js_vfs_create_file()*/)
////////////////////////////////////////////////////////////////////
- .t('Scalar UDFs', function(sqlite3){
- const db = this.db;
- db.createFunction("foo",(pCx,a,b)=>a+b);
- T.assert(7===db.selectValue("select foo(3,4)")).
- assert(5===db.selectValue("select foo(3,?)",2)).
- assert(5===db.selectValue("select foo(?,?2)",[1,4])).
- assert(5===db.selectValue("select foo($a,$b)",{$a:0,$b:5}));
- db.createFunction("bar", {
- arity: -1,
- xFunc: (pCx,...args)=>{
- let rc = 0;
- for(const v of args) rc += v;
- return rc;
- }
- }).createFunction({
- name: "asis",
- xFunc: (pCx,arg)=>arg
- });
- T.assert(0===db.selectValue("select bar()")).
- assert(1===db.selectValue("select bar(1)")).
- assert(3===db.selectValue("select bar(1,2)")).
- assert(-1===db.selectValue("select bar(1,2,-4)")).
- assert('hi' === db.selectValue("select asis('hi')")).
- assert('hi' === db.selectValue("select ?",'hi')).
- assert(null === db.selectValue("select null")).
- assert(null === db.selectValue("select asis(null)")).
- assert(1 === db.selectValue("select ?",1)).
- assert(2 === db.selectValue("select ?",[2])).
- assert(3 === db.selectValue("select $a",{$a:3})).
- assert(T.eqApprox(3.1,db.selectValue("select 3.0 + 0.1"))).
- assert(T.eqApprox(1.3,db.selectValue("select asis(1 + 0.3)")));
-
- let blobArg = new Uint8Array([0x68, 0x69]);
- let blobRc = db.selectValue("select asis(?1)", blobArg);
- T.assert(blobRc instanceof Uint8Array).
- assert(2 === blobRc.length).
- assert(0x68==blobRc[0] && 0x69==blobRc[1]);
- blobRc = db.selectValue("select asis(X'6869')");
- T.assert(blobRc instanceof Uint8Array).
- assert(2 === blobRc.length).
- assert(0x68==blobRc[0] && 0x69==blobRc[1]);
-
- blobArg = new Int8Array([0x68, 0x69]);
- //debug("blobArg=",blobArg);
- blobRc = db.selectValue("select asis(?1)", blobArg);
- T.assert(blobRc instanceof Uint8Array).
- assert(2 === blobRc.length);
- //debug("blobRc=",blobRc);
- T.assert(0x68==blobRc[0] && 0x69==blobRc[1]);
+ .t({
+ name:'Scalar UDFs',
+ //predicate: ()=>false,
+ test: function(sqlite3){
+ const db = this.db;
+ db.createFunction("foo",(pCx,a,b)=>a+b);
+ T.assert(7===db.selectValue("select foo(3,4)")).
+ assert(5===db.selectValue("select foo(3,?)",2)).
+ assert(5===db.selectValue("select foo(?,?2)",[1,4])).
+ assert(5===db.selectValue("select foo($a,$b)",{$a:0,$b:5}));
+ db.createFunction("bar", {
+ arity: -1,
+ xFunc: (pCx,...args)=>{
+ let rc = 0;
+ for(const v of args) rc += v;
+ return rc;
+ }
+ }).createFunction({
+ name: "asis",
+ xFunc: (pCx,arg)=>arg
+ });
+ T.assert(0===db.selectValue("select bar()")).
+ assert(1===db.selectValue("select bar(1)")).
+ assert(3===db.selectValue("select bar(1,2)")).
+ assert(-1===db.selectValue("select bar(1,2,-4)")).
+ assert('hi' === db.selectValue("select asis('hi')")).
+ assert('hi' === db.selectValue("select ?",'hi')).
+ assert(null === db.selectValue("select null")).
+ assert(null === db.selectValue("select asis(null)")).
+ assert(1 === db.selectValue("select ?",1)).
+ assert(2 === db.selectValue("select ?",[2])).
+ assert(3 === db.selectValue("select $a",{$a:3})).
+ assert(T.eqApprox(3.1,db.selectValue("select 3.0 + 0.1"))).
+ assert(T.eqApprox(1.3,db.selectValue("select asis(1 + 0.3)")));
+
+ let blobArg = new Uint8Array([0x68, 0x69]);
+ let blobRc = db.selectValue("select asis(?1)", blobArg);
+ T.assert(blobRc instanceof Uint8Array).
+ assert(2 === blobRc.length).
+ assert(0x68==blobRc[0] && 0x69==blobRc[1]);
+ blobRc = db.selectValue("select asis(X'6869')");
+ T.assert(blobRc instanceof Uint8Array).
+ assert(2 === blobRc.length).
+ assert(0x68==blobRc[0] && 0x69==blobRc[1]);
+
+ blobArg = new Int8Array([0x68, 0x69]);
+ //debug("blobArg=",blobArg);
+ blobRc = db.selectValue("select asis(?1)", blobArg);
+ T.assert(blobRc instanceof Uint8Array).
+ assert(2 === blobRc.length);
+ //debug("blobRc=",blobRc);
+ T.assert(0x68==blobRc[0] && 0x69==blobRc[1]);
+ }
})
////////////////////////////////////////////////////////////////////
.t({
name: 'Aggregate UDFs',
+ //predicate: ()=>false,
test: function(sqlite3){
const db = this.db;
const sjac = capi.sqlite3_js_aggregate_context;
.t({
name: 'Aggregate UDFs (64-bit)',
predicate: ()=>wasm.bigIntEnabled,
+ //predicate: ()=>false,
test: function(sqlite3){
const db = this.db;
const sjac = capi.sqlite3_js_aggregate_context;
////////////////////////////////////////////////////////////////////
.t({
name: 'Window UDFs',
+ //predicate: ()=>false,
test: function(){
/* Example window function, table, and results taken from:
https://sqlite.org/windowfunctions.html#udfwinfunc */
xEof: function(pCursor){
const c = VT.xCursor.get(pCursor),
rc = c._rowId>=10;
- c.dispose();
return rc;
},
xFilter: function(pCursor, idxNum, idxCStr,
try{
const c = VT.xCursor.get(pCursor);
c._rowId = 0;
- const list = VT.sqlite3ValuesToJs(argc, argv);
+ const list = capi.sqlite3_values_to_js(argc, argv);
T.assert(argc === list.length);
//log(argc,"xFilter value(s):",list);
- c.dispose();
return 0;
}catch(e){
return VT.xError('xFilter',e);
vtabTrace("xFilter",...arguments);
const c = VT.xCursor.get(pCursor);
c._rowId = 0;
- const list = VT.sqlite3ValuesToJs(argc, argv);
+ const list = capi.sqlite3_values_to_js(argc, argv);
T.assert(argc === list.length);
},
xBestIndex: function(pVtab, pIdxInfo){
-C Expose\ssqlite3_column_value()\sto\sWASM\sand\sadd\ssqlite3_column_js().
-D 2022-12-10T15:13:29.279
+C Remove\stwo\sincorrect\scalls\sto\sstructType.dipose()\swhich\sprematurely\sfreed\sobjects\sin\suse\sby\sthe\svirtual\stable\stest/demo\scode.
+D 2022-12-10T15:41:47.936
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F ext/wasm/api/sqlite3-api-worker1.js e94ba98e44afccfa482874cd9acb325883ade50ed1f9f9526beb9de1711f182f
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
F ext/wasm/api/sqlite3-opfs-async-proxy.js 7795b84b66a7a8dedc791340709b310bb497c3c72a80bef364fa2a58e2ddae3f
-F ext/wasm/api/sqlite3-v-helper.js 64bb3559446eb441ce87afe942f6f924ee135a9f069a82705ffefdcd55fc6481
+F ext/wasm/api/sqlite3-v-helper.js 6f6c3e390a72e08b0a5b16a0d567d7af3c04d172831853a29d72a6f1dd40ff24
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 66daf6fb6843bea615fe193109e1542efbeca24f560ee9da63375a910bb48115
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
F ext/wasm/api/sqlite3-wasm.c daad00c6822facb6ceb506dadc2201c734e9128c457c93f9304df01542084216
F ext/wasm/test-opfs-vfs.js 44363db07b2a20e73b0eb1808de4400ca71b703af718d0fa6d962f15e73bf2ac
F ext/wasm/tester1-worker.html d43f3c131d88f10d00aff3e328fed13c858d674ea2ff1ff90225506137f85aa9
F ext/wasm/tester1.c-pp.html d34bef3d48e5cbc1c7c06882ad240fec49bf88f5f65696cc2c72c416933aa406
-F ext/wasm/tester1.c-pp.js 88981420cd91fa134293fc15507b4c94923dab6b3d2e9fc9a4510fdb4f4c6368
+F ext/wasm/tester1.c-pp.js 3e9f1d92d9f3464954553d0aa918cba8294451e32a38c229ce5964818f707702
F ext/wasm/tests/opfs/concurrency/index.html 86d8ac435074d1e7007b91105f4897f368c165e8cecb6a9aa3d81f5cf5dcbe70
F ext/wasm/tests/opfs/concurrency/test.js a98016113eaf71e81ddbf71655aa29b0fed9a8b79a3cdd3620d1658eb1cc9a5d
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 35d1d63c7d60119b64341c561294890812837d5432d1d7bed3ed88d6212fbfa0
-R 74949983660f34694e10167d70549cc3
+P 7783aa4af1331190fd1f42a71bb724041e2e82b51745f9740926e4ead83a97ed
+R 665d2c5db7dd22191a3e1edf86f2deb6
U stephan
-Z 02a2b2f3f049d4f2376808efde37d6cf
+Z 3ceb2605e22c9be9046cc21f4a5a89d8
# Remove this line to create a well-formed Fossil manifest.