Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Returning zero from user-defined function treated as returning null

Open
#296 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, sqlite, wasm
Domain
database

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.

Description

db = new Database();
db.create_function(
    "returnZero",
    () => 0
);
db.exec("SELECT returnZero(), 0");

Expected:

returnZero() 0
0 0

Actual:

returnZero() 0
null 0
Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sql-js/sql.js

All issues in sql-js/sql.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.