Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accessing current time on VFS database throws bad function error #43

Closed
rhashimoto opened this issue Feb 20, 2022 · 2 comments
Closed

accessing current time on VFS database throws bad function error #43

rhashimoto opened this issue Feb 20, 2022 · 2 comments
Labels
bug

Comments

@rhashimoto
Copy link
Owner

@rhashimoto rhashimoto commented Feb 20, 2022

On the demo, accessing the current time, e.g. with:

SELECT datetime('now');

works on the default filesystem but fails with any custom VFS with:

RuntimeError: null function or function signature mismatch
    at https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.wasm:wasm-function[659]:0x38ed2
    at https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.wasm:wasm-function[1176]:0x57047
    at https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.wasm:wasm-function[503]:0x26f89
    at https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.wasm:wasm-function[1177]:0x5709b
    at https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.wasm:wasm-function[530]:0x2b26c
    at G (https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.mjs:17:311)
    at https://rhashimoto.github.io/wa-sqlite/dist/wa-sqlite.mjs:110:235
    at Object.step (https://rhashimoto.github.io/wa-sqlite/src/sqlite-api.js:562:28)
    at https://rhashimoto.github.io/wa-sqlite/src/examples/tag.js:37:28
    at async HTMLButtonElement. (https://rhashimoto.github.io/wa-sqlite/demo/index.js:121:23)

A custom VFS is supposed to borrow the default time method here but this is apparently broken.

@rhashimoto rhashimoto added the bug label Feb 20, 2022
@rhashimoto
Copy link
Owner Author

@rhashimoto rhashimoto commented Feb 26, 2022

xCurrentTime is not implemented in the default VFS because it uses xCurrentTimeInt64 instead. One should be added to libvfs.c.

@rhashimoto
Copy link
Owner Author

@rhashimoto rhashimoto commented Apr 23, 2022

SELECT datetime('now') works on Safari but the added unit test fails. So the bug appears fixed but apparently there's a browser-specific bug in the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
None yet
Development

No branches or pull requests

1 participant