Returning zero from user-defined function treated as returning null
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
db = new Database();
db.create_function(
"returnZero",
() => 0
);
db.exec("SELECT returnZero(), 0");
Expected:
| returnZero() | 0 |
|---|---|
| 0 | 0 |
Actual:
| returnZero() | 0 |
|---|---|
| null | 0 |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the JavaScript create_function entry point and follow how its callback result reaches the exec query result. Reproduce the supplied returnZero example and compare it with the literal 0 result. Done means the user-defined function returns 0 rather than null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, sqlite, wasm
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100