Skip to content

sqlite integer parameters should not be bound as doubles #63826

Description

@andrewitsover

Version

v26.2.0

Platform

Darwin rocksteady 25.5.0 Darwin Kernel Version 25.5.0: Mon Apr 27 20:40:51 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T8112 arm64

Subsystem

sqlite

What steps will reproduce the bug?

I am assuming parameters that are number are always bound as type double, but integers should be bound as type integer so that SQLite performs integer arithmetic and returns a type of integer instead of a type of double.

constdb=newDatabaseSync(':memory:',{readBigInts: true});constbig=db.prepare('select 2 * 2');constbigResult=big.all();constnotBig=db.prepare('select 2 * ?');constnotResult=notBig.all(2);

This is the offending code in nodejs:

constdouble val = value.As<Number>()->Value();

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

Integers should be bound as integers not double as they are integers.

What do you see instead?

Integers being bound as double.

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.sqliteIssues and PRs related to the SQLite subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions