IBM Support

IC90721: SQLGETDIAGFIELDW() RETURNS THE STRINGLENGTHPTR AS CHARACTERS INSTEAD OF BYTES.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The SQLGetDiagFieldW() API was changed in APAR# IC85013
    (available in DB2 Version 9.7 FP7) so that the StringLengthPtr
    returns the number of characters in the buffer instead of the
    number of bytes.
    
    The ODBC specifications require that StringLengthPtr for
    SQLGetDiagFieldW returns the number of bytes.
    
    This APAR reverts the changes that were made in APAR# IC85013.
    The DB2 documentation has been updated to indicate that this
    field returns the number of bytes.  The updated documentation
    can be found at the following link:
    http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.i
    bm.db2.luw.apdv.cli.doc/doc/r0000608.html
    
    Without the fix for this APAR, an ODBC application can abend.
    When an ODBC application abends, it might produce a stack that
    looks like the following:
    
    0012eb44 743269cd msvcrt!wcscpy+0xe
    0012f0cc 7432591c odbc32!VRetrieveDriverErrorsRowCol+0x3cd
    0012f120 743230de odbc32!FinishConnection+0x28
    0012f148 74322ad7 odbc32!SQLInternalDriverConnectW+0x268
    0012f8a4 74353111 odbc32!SQLDriverConnectW+0xb89
    0012f8dc 004011f1 odbc32!SQLDriverConnect+0x125
    0012fe1c 004010de dbconn!DbDriverConnect+0xe1
    0012ff78 004017a5 dbconn!main+0xbe
    0012ffc0 7c81776f dbconn!__tmainCRTStartup+0x10b
    0012fff0 00000000 kernel32!BaseProcessStart+0x23
    

Local fix

  • Use the SQLErrorW() instead of SQLGetDiagFieldW() API.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All users using ODBC                                         *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 version 9.7.0.8.                              *
    ****************************************************************
    

Problem conclusion

  • The problem is first fixed in DB2 version 9.7.0.8.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC90721

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    YesSpecatt / Installability

  • Submitted date

    2013-03-08

  • Closed date

    2013-03-25

  • Last modified date

    2013-03-26

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    IC92616

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
26 March 2013