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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.0.17, 3.0.5
    • 3.0.6, 2.0.18
    • General
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.