Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

sqlite integer parameters should not be bound as doubles

Aperta
#63,826 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
javascript, node.js, sqlite
Ambito
databases

Direzione di ricerca

Inizia in src/node_sqlite.cc, nel codice di binding dei parametri indicato, e riproduci il problema con gli esempi DatabaseSync forniti. Verifica come vengono classificati i parametri numerici prima che SQLite li riceva. Il lavoro è completo quando i parametri interi producono aritmetica intera in SQLite e il comportamento readBigInts segnalato è coperto dai test di regressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question sqlite
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.

const db = new DatabaseSync(':memory:', { readBigInts: true });
const big = db.prepare('select 2 * 2');
const bigResult = big.all();
const notBig = db.prepare('select 2 * ?');
const notResult = notBig.all(2);

This is the offending code in nodejs:
https://github.com/nodejs/node/blob/19c46abbefdb8711b913d7237b3c1299367f87d7/src/node_sqlite.cc#L2703

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

Lingua principale
JavaScript
Stelle
122k
Fork
37.4k
Merge medio
4g 3h
PR unite (30g)
279

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nodejs/node

Tutte le issue di nodejs/node

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.