Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.0.17, 3.0.5
-
None
Description
Also octet length is incorrect - should be size of corresponding struct(SQL_TIME/DATE/TIMESTAMP_STRUCT)
https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/display-size?view=sql-server-2017
https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/column-size?view=sql-server-2017
https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/transfer-octet-length?view=sql-server-2017
OK_SIMPLE_STMT(Stmt, "CREATE TABLE fraction_test(ts timestamp(4)");
OK_SIMPLE_STMT(Stmt, "SELECT ts from fraction_test");
CHECK_STMT_RC(Stmt, SQLColAttribute(Stmt, 1, SQL_COLUMN_DISPLAY_SIZE, NULL, 0, NULL, &Size));
diag("Display size: %lu", Size);
CHECK_STMT_RC(Stmt, SQLColAttribute(Stmt, 1, SQL_DESC_LENGTH, NULL, 0, NULL, &Size));
diag("Column size: %lu", Size);
CHECK_STMT_RC(Stmt, SQLColAttribute(Stmt, 1, SQL_DESC_OCTET_LENGTH, NULL, 0, NULL, &Size));
diag("Octet length: %lu", Size);
The output would be 19, 19 and 19. While it should be 24, 24 and 16