Skip to content

[C++][FlightSQL][ODBC][SQLColumns] Return NUM_PREC_RADIX based on COLUMN_SIZE and DECIMAL_DIGITS  #47159

@alinaliBQ

Description

@alinaliBQ

Describe the enhancement requested

Currently, NUM_PREC_RADIX column in SQLColumns is returning default values based on data types. The code makes an assumption that the server always returns number of digits for decimal, numeric, smallint, tinyint, integer, and bigint data types. And assumes the server returns number of bits for real, float, and double. But the server could return number of bits for non-floating point data too. The driver needs a reliable way to tell if COLUMN_SIZE is returning number of digits or bits for the data type.

Code where NUM_PREC_RADIX is returned:

optional<int16_t> GetRadixFromSqlDataType(odbcabstraction::SqlDataType data_type) {

Suggested AC:

  • For SQLColumns, return NUM_PREC_RADIX based on COLUMN_SIZE and DECIMAL_DIGITS instead of default values based on data type.

Parent issue: #30622

Component(s)

C++, FlightRPC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions