Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
31ac5a7
REFACTOR: Keep fetchmany column metadata native and call-local
jahnvi480 Sep 17, 2026
5b65844
Merge branch 'main' into jahnvi/perf-small-fetch-native-metadata
jahnvi480 Sep 21, 2026
3f81bde
Merge branch 'main' into jahnvi/perf-small-fetch-native-metadata
jahnvi480 Sep 22, 2026
abb3808
Merge branch 'main' into jahnvi/perf-small-fetch-native-metadata
jahnvi480 Sep 22, 2026
296836f
Merge main through #795 into metadata optimization
jahnvi480 Sep 22, 2026
252e9b6
PERF: Reuse stable native metadata within result sets
jahnvi480 Sep 22, 2026
abd4f4b
REFACTOR: Extract child result metadata invalidation helper
jahnvi480 Sep 22, 2026
c5fe142
CHORE: Harden native metadata regression coverage
jahnvi480 Sep 22, 2026
416e54d
CHORE: Address native metadata test review findings
jahnvi480 Sep 22, 2026
7c7e6d2
PERF: Reuse native fetch buffers and ODBC bindings
jahnvi480 Sep 22, 2026
90e8aa3
Merge validated #796 dependency and native test integration
jahnvi480 Sep 22, 2026
d0af2ac
Merge branch 'main' into jahnvi/perf-small-fetch-native-metadata
jahnvi480 Sep 22, 2026
65081f0
REFACTOR: Minimize metadata optimization scope
jahnvi480 Sep 24, 2026
13ad116
REFACTOR: Minimize retained fetch-binding scope
jahnvi480 Sep 24, 2026
adebf37
Merge origin/main after PR #796
jahnvi480 Sep 24, 2026
060d6ce
Merge origin/main after PR809 into fetch buffer reuse
jahnvi480 Sep 24, 2026
eb4e2f8
Merge branch 'main' into jahnvi/perf-fetch-buffer-reuse
bewithgaurav Sep 25, 2026
9eb586a
FIX: Address fetch buffer reuse review feedback
jahnvi480 Sep 25, 2026
be219eb
FIX: Use supported codecs in fetch binding reuse regression
jahnvi480 Sep 25, 2026
1c05d11
FIX: Cover native fetch cleanup failure ownership
jahnvi480 Sep 25, 2026
ad0a855
CHORE: Revert cleanup-failure test infrastructure
jahnvi480 Sep 25, 2026
99c5a56
FIX: Add focused failed-unbind regression
jahnvi480 Sep 25, 2026
db19e63
FIX: Assert failed cleanup cannot advance native fetches
jahnvi480 Sep 25, 2026
39e2209
FIX: Cover failed rows-fetched pointer cleanup
jahnvi480 Sep 25, 2026
83bb847
Merge branch 'main' into jahnvi/perf-fetch-buffer-reuse
jahnvi480 Sep 28, 2026
dead1ca
Merge branch 'main' into jahnvi/perf-fetch-buffer-reuse
jahnvi480 Sep 28, 2026
4d12d4f
FIX: Avoid iostreams in native handle shutdown diagnostics
jahnvi480 Sep 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions mssql_python/pybind/connection/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void Connection::connect(const py::dict& attrs_before) {

void Connection::disconnect(bool rollbackBeforeDisconnect) {
PERF_TIMER("Connection::disconnect");
clearResultMetadata();
clearResultMetadata(false);
// Determine GIL state once, up front. disconnect() runs both from
// pybind11-bound methods (GIL held) and from GIL-less destructor / shutdown
// paths: Connection::~Connection() dropping the last shared_ptr, or teardown
Expand Down Expand Up @@ -169,10 +169,10 @@ void Connection::disconnect(bool rollbackBeforeDisconnect) {
// Also cover children whose weak_ptr expired as their destructor
// began waiting for this gate: they cannot appear in the snapshot.
_cleanupState->disconnected = true;
std::lock_guard<std::mutex> lock(_childHandlesMutex);
for (const auto& handle : childHandles) {
handle->markImplicitlyFreed();
}
std::lock_guard<std::mutex> lock(_childHandlesMutex);
_childStatementHandles.clear();
_allocationsSinceCompaction = 0;
}
Expand Down Expand Up @@ -266,7 +266,7 @@ void Connection::checkError(SQLRETURN ret) const {
}
}

void Connection::clearResultMetadata() {
void Connection::clearResultMetadata(bool detachFetchBindings) {
std::vector<SqlHandlePtr> handles;
{
std::lock_guard<std::mutex> lock(_childHandlesMutex);
Expand All @@ -281,6 +281,9 @@ void Connection::clearResultMetadata() {
// Keep that destruction outside the child-list lock.
for (const auto& handle : handles) {
handle->resultMetadata.clear();
if (detachFetchBindings && handle->fetchBindings.hasPlan()) {
handle->requireDetachedFetchBindings();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion mssql_python/pybind/connection/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Connection {
void allocateDbcHandle();
void checkError(SQLRETURN ret) const;
void applyAttrsBefore(const py::dict& attrs_before);
void clearResultMetadata();
void clearResultMetadata(bool detachFetchBindings = true);

std::u16string _connStr;
bool _fromPool = false;
Expand Down
Loading
Loading