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

Aperta
#1,035 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

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.

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

Descrizione

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

Lingua principale
Python
Stelle
236
Fork
162
Merge medio
13h 13m
PR unite (30g)
23

Preparare l'ambiente

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 databricks/databricks-sql-python

Tutte le issue di databricks/databricks-sql-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.