Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-157

Display size and Column lenght do not include fractional part for (date)time types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.17, 3.0.5
    • Fix Version/s: 3.0.6, 2.0.18
    • Component/s: General
    • 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

        Attachments

          Activity

            People

            Assignee:
            Lawrin Lawrin Novitsky
            Reporter:
            Lawrin Lawrin Novitsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: