Skip to content

[C++][FlightSQL][ODBC][SQLGetTypeInfo] Fix return values for searchable #47237

@alinaliBQ

Description

@alinaliBQ

Describe the enhancement requested

Current behavior:
flightsql-odbc backend doesn't differentiate between SQL_PRED_CHAR, SQL_PRED_BASIC, and SQL_SEARCHABLE. SQL_SEARCHABLE is returned by default when the Arrow data type is searchable. This causes a problem because types like bit is searchable, but it is generally not supported in LIKE clause, so SQL_PRED_BASIC is more appropriate compared to SQL_SEARCHABLE.

This is a minor issue that's not impacting most BI tools.

data.searchable = reader.GetSearchable() ? odbcabstraction::SEARCHABILITY_ALL
: odbcabstraction::SEARCHABILITY_NONE;

SQLGetTypeInfo spec for reference on definitions of SQL_PRED_*: https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/SQLGetTypeInfo-function?view=sql-server-ver17

AC:

  • When a data type is searchable, the ODBC should return SQL_PRED_CHAR or SQL_PRED_BASIC for the appropriate data types

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