memsql / singlestore-odbc-connector

8 stars 2 forks source link

Wrong SQLColAttribute SQL_DESC_PRECISION values for FLOAT and DOUBLE columns #14

Closed vkr-ayx closed 3 weeks ago

vkr-ayx commented 2 months ago

I'm using SingleStore driver 1.1.5. When calling SQLColAttribute function on FLOAT and DOUBLE columns, unexpected values are returned for SQL_DESC_PRECISION:

FLOAT:

SQL_DESC_CONCISE_TYPE: 7 (= SQL_REAL) SQL_COLUMN_LENGTH: 4 SQL_DESC_OCTET_LENGTH: 4 SQL_DESC_LENGTH: 7 SQL_DESC_PRECISION: 48

According to the SingleStore documentation, precision of the FLOAT datatype is 23 bits. The value returned is 48.

DOUBLE:

SQL_DESC_CONCISE_TYPE: 8 (= SQL_DOUBLE) SQL_COLUMN_LENGTH: 8 SQL_DESC_OCTET_LENGTH: 8 SQL_DESC_LENGTH: 15 SQL_DESC_PRECISION: 0

For the DOUBLE type, the precision returned is 0, which is clearly wrong.

vkr-ayx commented 2 months ago

Querying table structure with mysql-client: float