ClickHouse / ClickHouse/clickhouse-odbc

Fail to get correct precison and scale of decimal through ODBC SQLDescribeColW()

Open
#412 0 comments 0 reactions 0 assignees View on GitHub
Type Info
Dominant language
C
Stars
285
Forks
105
Avg merge
3h 56m
Merged PRs (30d)
3

Description

Environment:
Clickhouse ODBC driver version: latest one downloaded from https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.2.1.20220905/clickhouse-odbc-windows.zip
Windows 10

Steps:
1. create and insert data by SQL:
CREATE TABLE test_decimal_X
(
`id` String,
`test_decimal` Decimal(18,10)
)
ENGINE = MergeTree
ORDER BY id

INSERT INTO test_decimal_X VALUES('2',10.12)

2. set up ODBC connection

3. After setting up odbc connection, we use SQLDescribeColW() (written in c++ ) to get precision and scale of decimal, but get result: type=decimal,precision=41,scale=0, 4.

4. The sql I execute is: SELECT T0.`id` AS `id`,T0.`test_decimal` AS `test_decimal` FROM `test_decimal_X` T0. The error I get is : HY000[1] Cannot interpret ‘10.12’ as signed 64-bit integer: Cannot string consumed partially.

Expectation:
Expect to get correct precision and scale of decimal through SQLDescribeColW() .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.