Skip to content

ResultSet::getString() throws std::bad_alloc with IBM Db2 CLI unless getStringLength() is called first. #56

Description

@nemesysolano

Summary

ResultSet::getString() throws std::bad_alloc when retrieving a string column through the IBM Db2 CLI/ODBC driver from C++ programs compiled with clang or g++ with -std=c++23 flag.

Calling ResultSet::getStringLength() for the same column immediately before getString() makes the retrieval succeed.

The query itself works correctly through isql, so the Db2 datasource, authentication, SQL statement, and IBM CLI/ODBC driver are functional.

Environment

  • OS: Ubuntu 22.04
  • Compiler: clang++ 18
  • C++ standard: C++23
  • Driver manager: unixODBC
  • Database: IBM Db2 LUW
  • Db2 driver: IBM Data Server Driver for ODBC and CLI
  • Driver library: libdb2.so
  • Wrapper: odbc-cpp-wrapper

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions