[coverage] Conformance findings: PARAMQUERY-021

未关闭
#490 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
领域
backend, databases

调研方向

失败的 xfail 名为 “DECIMAL target — a scale-less DECIMAL declaration must not truncate the value’s fractional digits”,并在 coverage PR 1179 的 tests/ 下被引用。首先定位 DBSQLParameterType.DECIMAL 的 Thrift 参数绑定路径,并针对 connector 运行覆盖率测试。当已声明、无 scale 以及声明不足的 DECIMAL target 都能保留值的每一位小数且不发生截断时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Summary

Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-nodejs. Each finding is committed as an expected-failure (xfail) test in the coverage PR — the test asserts the CORRECT (post-fix) behavior and stays red until THIS driver (databricks/databricks-sql-nodejs) is fixed, then flips green as a tripwire.

Findings

  • PARAMQUERY-021 [thrift]: Thrift path truncates a scale-less DECIMAL target: '123.45' bound as DBSQLParameterType.DECIMAL rides with scale 0, so SELECT :v returns 123, destroying the fractional digits
    • failing test: DECIMAL target — a scale-less DECIMAL declaration must not truncate the value’s fractional digits [xfail: thrift] (see the coverage PR diff under tests/)
  • PARAMQUERY-021: Thrift path truncates a scale-less DECIMAL target: '123.45' bound as DBSQLParameterType.DECIMAL is sent with scale 0, so SELECT :v returns 123 instead of 123.45, silently destroying the value's fractional digits (the SEA/kernel path returns 123.45 correctly)

Reproduce & Expected

PARAMQUERY-021 — Verify that declaring a DECIMAL/NUMERIC target type for a bound parameter never silently drops fractional digits.

Reproduce:

SELECT ? AS v
SELECT ? AS v
SELECT ? AS v

Expected (per the shared spec):

  • All three binds prepare and execute successfully.
  • (a) The declared DECIMAL(10,2) accommodates the value, so the parameter rides as that decimal type and the value compares numerically equal to 123.45 with both fractional digits intact.
  • (b) THE CORE GUARANTEE: with no declared scale, the value is still 123.45 -- NOT 123. Assert the value, not the reported column type: a conforming driver may legitimately deliver this as a decimal the server inferred from the literal OR as the lossless text/string form, so the type is implementation latitude while the VALUE is the contract.
  • (c) The value's own scale (4) is authoritative over the under-declared target scale (2): all four fractional digits survive. A result of 123.45 (or 123) is a truncation violation.

Context

主要语言
TypeScript
星标
36
派生
50
平均合并
13 小时 46 分钟
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

databricks/databricks-sql-nodejs 的其他 Issue

查看 databricks/databricks-sql-nodejs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。