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

SQL_C_FLOAT should be mapped to SQLREAL, and not to SQLFLOAT

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 3.2.0, 3.1.18
    • General
    • None

    Description

      https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/c-data-types?view=sql-server-ver16
      Also, SQL_FLOAT should be mapped to SQL_C_DOUBLE, and not SQL_C_FLOAT.
      In particular, this can cause.
      SQLFLOAT has size 8 bytes - basically it's defined as double, and SQLREAL has size 4 bytes - it is float. In most cases this cause no problem, but can crash application if a rowset(array of rows) is fetched using column-wise binding, and one of fields is fetched to SQL_C_FLOAT buffer. In this case, because of the wrong assumed single field buffer size, connector calculates wrong address to write values from following rows values, and eventually can write past boundary of the allocated array. Correct mapping fixes that issue

      Attachments

        Issue Links

          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.