ClickHouse / clickhouse-odbc

ODBC driver for ClickHouse

Home Page:https://clickhouse.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

got code SQL_INVALID_HANDLE when SQLGetData called

superceix opened this issue · comments

commented

As the title suggests, I encountered the SQL_INVALID_HANDLE error from SQLGetData function. It appears that the Driver::call function is not thread safe.

To address this issue, I attempted to add a return code in order to obtain the error code -99:
image

In my program, multiple threads call ODBC functions simultaneously. Therefore, I suspect that when one thread is executing SQLGetData, and another thread is creating a new session, the 'descendants' variable is not protected by thread safety measures.