[coverage] Conformance findings: PARAMQUERY-022,PARAMQUERY-023

未關閉
#1,035 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
54/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python

研究方向

Start by locating DecimalParameter and the Thrift and SEA parameter binding paths, then inspect the named xfail tests in the coverage PR under tests/. Check how Decimal values are serialized and how precision is validated before execution. Done means exponent-form values bind as plain numerals with correct DECIMAL precision and scale, and values beyond maximum precision fail before ExecuteStatement.

由索引模型根據 Issue 內容生成。

描述

Summary

Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-python. 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-python) is fixed, then flips green as a tripwire.

Findings

  • PARAMQUERY-022 [thrift]: DecimalParameter renders a bound DECIMAL's wire value as str(Decimal) and derives DECIMAL(p,s) by counting that string's characters, so Decimal("1e-7") is sent as value "1E-7" with type DECIMAL(4,0) and the server rounds the value to 0 instead of binding 0.0000001 as DECIMAL(7,7)
    • failing test: test_exponent_notation_decimal_parameter_binds_as_plain_numeral (see the coverage PR diff under tests/)
  • PARAMQUERY-022 [sea]: the connector sends a bound DECIMAL's value in exponent notation ("1E-7") on the SEA wire rather than the equivalent plain numeral "0.0000001"; the Rust kernel re-derives DECIMAL(7,7) so the value is NOT lost on SEA, but the plain-numeral wire form is not met (same str(Decimal) root cause as the Thrift truncation)
    • failing test: test_exponent_notation_decimal_parameter_binds_as_plain_numeral (see the coverage PR diff under tests/)
  • PARAMQUERY-023 [thrift]: the Thrift path performs no client-side precision validation for a bound DECIMAL: a 39-digit value is derived as DECIMAL(39,0) and sent, failing server-side with INVALID_PARAMETER_MARKER_VALUE.INVALID_DATA_TYPE (SQLSTATE 22023) instead of raising a bind-time parameter error before any ExecuteStatement, as the Rust-kernel/SEA path correctly does
    • failing test: test_decimal_parameter_beyond_maximum_precision_rejected_before_execution (see the coverage PR diff under tests/)
  • PARAMQUERY-022: DecimalParameter renders a bound DECIMAL's wire value as str(Decimal) and derives DECIMAL(p,s) by counting that string's characters, so an exponent-form value is corrupted on Thrift: Decimal("1e-7") is sent as value "1E-7" with type DECIMAL(4,0) and the server rounds it to 0 (on SEA the Rust kernel re-derives DECIMAL(7,7) so the value survives, but "1E-7" still rides the wire instead of the plain numeral "0.0000001")
  • PARAMQUERY-023: the Thrift path performs no client-side precision validation for a bound DECIMAL: a 39-digit value is derived as DECIMAL(39,0) and sent, so it fails server-side with INVALID_PARAMETER_MARKER_VALUE.INVALID_DATA_TYPE (SQLSTATE 22023) instead of raising a bind-time parameter error before any ExecuteStatement, as the Rust-kernel/SEA path correctly does

Context

主要語言
Python
星號
236
分支
162
平均合併
13 小時 13 分鐘
30 天內合併 PR
23

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/databricks-sql-python 的其他 Issue

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

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。