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

[BUG] Queries return parse error when using a table alias

Aperta
#425 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
database

Direzione di ricerca

Nel report non sono identificati file del repository, test o punti di ingresso. Inizia riproducendo le query con alias e con join usando node-odbc 2.4.9, MDBTools e Access, quindi confrontale con la query funzionante e con i risultati di DBeaver. Il lavoro è completato quando le query segnalate vengono analizzate ed eseguite senza l'errore ODBC, oppure quando il limite del driver è documentato chiaramente.

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

Descrizione

Describe your system

  • odbc Package Version: [email protected]
  • ODBC Driver: MDBTools
  • Database Name: Access
  • Database Version: uncertain
  • Database OS: running through kubuntu using ODBC
  • Node.js Version: v20.15.0
  • Node.js OS: kubuntu 24.04

Describe the bug
I have this code:
const odbc = require('odbc'); const connection = odbc.connect('DSN=my_db', (error, connection) => { connection.query('select * from Objects limit 10', (error, result) => { if (error) { console.error(error) } console.log(result.columns) }); });

which works with no issues. However, if I modify the query with an alias like:

'select * from Objects a1a limit 10'

I get this error:

Got no result for 'select * from Objects a1a limit 10' command [Error: [odbc] Error executing the sql statement] { odbcErrors: [ { state: '', code: 1, message: "Couldn't parse SQL\n" } ] }

In addition, if I put any joins in the query I get the exact same error. For example:

select objects.ID, objects.Object, objects.CardID, objects.SetID, objects.Name, sets.name as set_name from Objects inner join sets on sets.id = Objects.setid where sets.name in ('The Awesome Planet') limit 10

If I run these same queries in DBeaver they return data with no errors.

Expected behavior
The query to parse with no errors.

To Reproduce
Steps to reproduce the behavior:
Described above.

  • The offending code:
  • Any DEBUG information printed to the terminal: Described above
  • Any error information returned from a function call: Described above
Lingua principale
JavaScript
Stelle
159
Fork
92
Merge medio
5h 59m
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 IBM/node-odbc

Tutte le issue di IBM/node-odbc

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.