ydb-platform / ydb-platform/ydb-php-sdk

bug: Decimal implemented, but didn't work

Open
#262 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.