[ODBC-157] Display size and Column lenght do not include fractional part for (date)time types Created: 2018-07-08  Updated: 2018-07-10  Resolved: 2018-07-09

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 2.0.17, 3.0.5
Fix Version/s: 3.0.6, 2.0.18

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: 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



 Comments   
Comment by Lawrin Novitsky [ 2018-07-09 ]

The fix has been pushed into odbc-3.0 and merged into master as c6085eb. Yet to be merged into 2.0

Generated at Thu Feb 08 03:26:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.