ClickHouse / clickhouse-odbc

ODBC driver for ClickHouse
https://clickhouse.tech
Apache License 2.0
239 stars 84 forks source link

got code SQL_INVALID_HANDLE when SQLGetData called #426

Open superceix opened 11 months ago

superceix commented 11 months ago

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.