Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2702

[ODBC] The SQL type is set to CHAR (n) CHARACTER SET USC2, SQLGetData to read data multiple times returns the wrong length value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0, 2.3
    • 2.2.0, 2.3
    • client-odbc-linux
    • None
    • CentOS

    Description

      The SQL type is set to 'CHAR (N)' CHARACTER SET USC2, SQLGetData will read data multiple times when the length of buffer is less than the length of the data but returns wrong size of length.
      "CREATE TABLE TB_DEBUG(C1 CHAR(20) CHARACTER SET UCS2)"
      "INSERT INTO TB_DEBUG VALUES (_UCS2'0123456789abcdefghij')"
      "select * from TB_DEBUG"
      SQLFetch(hstmt);
      while (retcode != SQL_NO_DATA_FOUND)
      ...
      retcode = SQLGetData(hstmt,(SWORD)(1),SQL_C_CHAR,UCS2Output,11,&len);
      ...

      the SQLGetData will return 5 times and the len is 20,31,21,11,1

      Attachments

        Activity

          People

            Unassigned Unassigned
            haolin.song haolin.song
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: