-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: binary protocol bug with decimal #25460
Copy link
Copy link
Closed
Labels
A-sql-pgwirepgwire protocol issues.pgwire protocol issues.C-investigationFurther steps needed to qualify. C-label will change.Further steps needed to qualify. C-label will change.O-communityOriginated from the communityOriginated from the communityS-3-erroneous-edge-caseDatabase produces or stores erroneous data without visible error/warning, in rare edge cases.Database produces or stores erroneous data without visible error/warning, in rare edge cases.
Description
I am trying to store some decimal values using Elixir / Ecto and it seems CRDB is not decoding the passed value properly:
The discount field is defined as DECIMAL(13,4) in the table.
On Elixir/Ecto side
INSERT INTO "passes" ("discount", ...) VALUES ($1, ...) [#Decimal<15>, ...]
On CRDB side:
"INSERT INTO passes(discount, ...) VALUES ($1, ...)" {$1:"1500000.0000", ...} 1.047 1 ""
CRDB info:
❯ cockroach version
Build Tag: v2.0.1
Build Time: 2018/04/23 19:18:28
Distribution: CCL
Platform: darwin amd64 (x86_64-apple-darwin17.5.0)
Go Version: go1.10.1
C Compiler: 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)
Build SHA-1: c92bc6e912880c28c0784d3208583fb27f482f76
Build Type: development
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-pgwirepgwire protocol issues.pgwire protocol issues.C-investigationFurther steps needed to qualify. C-label will change.Further steps needed to qualify. C-label will change.O-communityOriginated from the communityOriginated from the communityS-3-erroneous-edge-caseDatabase produces or stores erroneous data without visible error/warning, in rare edge cases.Database produces or stores erroneous data without visible error/warning, in rare edge cases.