SQLColAttribute implementation - #68
Conversation
35887e5 to
b9ed5f7
Compare
b9ed5f7 to
9d7661e
Compare
e14177e to
3e1002a
Compare
* Fixed bug with incorrect column count. It was returning column count + 1. * Fixed bug with incorrect numPrecRadix. It was returning SQL_NO_TOTAL (maps to -4) for non-numeric columns, but the correct value is 0. * Fixed bug with unsigned column to return true for unsigned columns (non-numeric columns or unsigned numeric columns) and false for signed columns (numeric columns) * Fixed bug with incorrect non-concise data type return value for date time type types. The correct return is SQL_DATETIME for all date time types
3e1002a to
b78bc31
Compare
| ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt); | ||
| ODBCDescriptor* ird = statement->GetIRD(); | ||
| SQLINTEGER outputLengthInt; | ||
| switch (fieldIdentifier) { |
There was a problem hiding this comment.
SQLColAttribute needs to handle the special SQL_COLUMN_* identifiers. I think these were for ODBC 2.x. Please test these as well.
There was a problem hiding this comment.
Yup. I have added implementation for SQL_COLUMN_LENGTH, SQL_COLUMN_PRECISION, and SQL_COLUMN_SCALE, and made them return the same values as their corresponding SQL_DESC_* identifiers. For the rest of the SQL_COLUMN_* identifiers, they are the same values as the corresponding SQL_DESC_* identifiers, and the driver manager will map them accordingly. I have added ODBC Ver2 tests with SQLColAttributes that pass SQL_COLUMN_* identifiers as arguments.
* use const for `ConvertToWString` * add nullptr check in odbc_api.cc layer * Add support for `SQL_COLUMN_LENGTH`, `SQL_COLUMN_PRECISION`, and `SQL_COLUMN_SCALE`. The driver will return the same values for ODBC2 and ODBC3. * Add tests for ODBC v2 SQLColAttributes values * I converted tests that can be run on remote servers where possible
alinaliBQ
left a comment
There was a problem hiding this comment.
Addressed comments from James
| ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt); | ||
| ODBCDescriptor* ird = statement->GetIRD(); | ||
| SQLINTEGER outputLengthInt; | ||
| switch (fieldIdentifier) { |
There was a problem hiding this comment.
Yup. I have added implementation for SQL_COLUMN_LENGTH, SQL_COLUMN_PRECISION, and SQL_COLUMN_SCALE, and made them return the same values as their corresponding SQL_DESC_* identifiers. For the rest of the SQL_COLUMN_* identifiers, they are the same values as the corresponding SQL_DESC_* identifiers, and the driver manager will map them accordingly. I have added ODBC Ver2 tests with SQLColAttributes that pass SQL_COLUMN_* identifiers as arguments.
SQLColAttribute implementation and tests.