[BUG] Queries return parse error when using a table alias
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
- 领域
- database
调研方向
报告中没有确定任何仓库文件、测试或入口点。首先使用 node-odbc 2.4.9、MDBTools 和 Access 重现带别名的查询和连接查询,然后将它们与可正常工作的查询及 DBeaver 的结果进行比较。当报告中的查询能够在不出现 ODBC 错误的情况下完成解析和执行,或清楚地记录驱动程序边界时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe your system
odbcPackage 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
- 主要语言
- JavaScript
- 星标
- 159
- 派生
- 92
- 平均合并
- 3 分钟
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IBM/node-odbc 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
security
难度 3/5 1-2 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 38/100
相似的 Issue
-
correction via-web
难度 2/5 1-3 小时 新手友好度 67/100
ch-bas/cctv-camera-database#416 ·
维护者通常 1 天内回复
-
bug effort:medium model:light tests
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 72/100
piskyRpapalo/preceptoros-web#231 ·
维护者通常 1 天内回复
-
type/bug type/docs type/enhancement
难度 1/5 1 小时以内 新手友好度 86/100
Redo-San/RedoSan-Authenticity#574 ·
维护者通常 1 天内回复
-
Place search spins forever when nominatim fails可能已有人在做 @jgt87 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
anvaka/city-roads#213 ·