`ResultSet::getString()` throws `std::bad_alloc` with IBM Db2 CLI unless `getStringLength()` is called first.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the reported ResultSet::getString() and getStringLength() behavior using the IBM Db2 CLI/ODBC driver on Ubuntu 22.04 with clang++ 18 or g++ and C++23. The uploaded odbc-cpp-wrapper-db2luw-test.cpp was not available, so first reproduce the failure and compare retrieval with and without the preceding length call; done means string retrieval succeeds without that workaround.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C++
- Stars
- 53
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SAP/odbc-cpp-wrapper
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SAP/odbc-cpp-wrapper#47 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
SAP/odbc-cpp-wrapper#3 · 2 comments ·
All issues in SAP/odbc-cpp-wrapper
Similar issues
-
ai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ydb-platform/ydb#53869 · 3 comments ·
-
bug cert blocker needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31035 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vllm-project/vllm-ascend#17329 ·