Skip to content

Commit e895c92

Browse files
TimelordUKclaude
andcommitted
fix: initialize _pollingEnabled from operationParams to prevent Linux crash
The _pollingEnabled flag was never being initialized from the query's polling parameter (operationParams->polling). This caused Cancel() to take the wrong code path on Linux: - With _pollingEnabled=false, Cancel() called SQLCancelHandle() directly - SQLCancelHandle() called concurrently with SQLExecDirectW caused a double-free crash on Linux (works on Windows) Now _pollingEnabled is properly set from the operation params in the constructor, so when polling mode is requested, the cooperative cancel path is used (_cancelRequested flag) instead of direct SQLCancelHandle. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 8350a81 commit e895c92

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/src/odbc/odbc_statement_legacy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ OdbcStatementLegacy::OdbcStatementLegacy(
202202
// cerr << "OdbcStatement() " << _statementId << " " << endl;
203203
// fprintf(stderr, "OdbcStatement::OdbcStatement OdbcStatement ID = %ld\n ", statement_id);
204204
_numericStringEnabled = _operationParams->numeric_string;
205+
_pollingEnabled.store(_operationParams->polling);
205206
_errors = make_shared<vector<shared_ptr<OdbcError>>>();
206207
}
207208

0 commit comments

Comments
 (0)