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

SQLGetData() should allow a NULL TargetValuePtr to fetch the length

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 3.0.1
    • 3.0.1
    • None
    • None
    • Ubuntu 16.04, but not specific to Ubuntu

    Description

      In SQLGetData() in odbc_3_api.c, there is a check for if (TargetValuePtr == NULL) and if it is NULL, it returns HY009. However, it is common practice when fetching data from TEXT field to not know what buffer size is needed, and therefore simply pass NULL for TargetValuePtr and 0 for BufferLength to get the buffer size needed returned via StrLen_or_IndPtr then call SQLGetData() again with a sufficient buffer.

      Simply commenting out this sanity check appears to work as expected.

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            bradh352 Brad House
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.