ydb-platform / ydb-platform/ydb-php-sdk
bug: Decimal implemented, but didn't work
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 39
- Forks
- 19
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 2
Description
Bug Report
Current behavior:
Trying to create Decimal param:
(new DecimalType($this->fromBalance))->digits(20)->scale(8)->toTypedValue()
While sending request with decimal param got error:
13:54:29 YDB Table ExecuteDataQuery (YDB_400010 BAD_REQUEST): ydb/core/kqp/session_actor/kqp_session_actor.cpp:1600: ydb/core/kqp/query_data/kqp_query_data.cpp:259: Parameter $fromBalance type mismatch, expected: { Kind: Data Data { Scheme: 4865 DecimalParams { Precision: 20 Scale: 8 } } }, actual: Type (Data), schemeType: String, schemeTypeId: 4097
Expected behavior:
Query works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing DecimalType in the PHP SDK and how toTypedValue() binds the value for YDB query parameters. Reproduce the shown $fromBalance request and inspect the resulting parameter type; done means the query accepts DecimalParams with precision 20 and scale 8 without a type-mismatch error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100