Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test that will check if types are reported properly #274

Open
filimonov opened this issue Mar 2, 2020 · 0 comments · May be fixed by #277
Open

Add a test that will check if types are reported properly #274

filimonov opened this issue Mar 2, 2020 · 0 comments · May be fixed by #277

Comments

@filimonov
Copy link
Collaborator

filimonov commented Mar 2, 2020

SQLDescribeCol
SQLGetTypeInfo
SQLColAttribute

We expect that:

  1. type should be reported properly
    (U)Int8 => SQL_TINYINT
    (U)Int16 => SQL_SMALLINT
    (U)Int32 => SQL_INTEGER
    (U)Int64 => SQL_BIGINT
    Float32 => SQL_REAL
    Float64 => SQL_DOUBLE
    FixedString => SQL_CHAR / SQL_BINARY (?)
    String => SQL_LONGVARBINARY / SQL_LONGVARCHAR (?)
    DateTime => SQL_TYPE_TIMESTAMP / SQL_TYPE_UTCDATETIME (?)
    DateTime64 => SQL_TYPE_TIMESTAMP / SQL_TYPE_UTCDATETIME (?)
    UUID => SQL_GUID
    Decimal => SQL_DECIMAL / SQL_NUMERIC (?)
    IPv4 ??
    IPv6 ??
    LowCardinality(...) => not affect the behavior
    All other types => SQL_LONGVARBINARY 'as is' in ODBCDriver2, exception on RowBinary (AggregateFunction state can't be skipped w/o parsing)
    https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/sql-data-types?view=sql-server-ver15
    etc.
  2. ColumnSize reported properly (FixedString / Decimal)
  3. Nullable reported properly
  4. [3] An application uses SQLGetTypeInfo or SQLColAttribute to determine whether a particular data type or a particular column in a result set is unsigned.

Table of types mapping (as above) - nice to see the reviewed table in docs.

@traceon traceon linked a pull request Mar 6, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant