Skip to content

Commit 66f8194

Browse files
Jay Edgarfacebook-github-bot
authored andcommitted
Fix bug introduced in D67400934
Summary: In D67400934 the RowStream object (stored in `current_row_stream_`) would be freed on a cancel. However, there was at least one code path where we could attempt to access it again in this scenario. This broke a handful of tests. Fix the code to correctly handle this scenario. Differential Revision: D67909302 fbshipit-source-id: cfad60ec70521378b73bd4e14a9e20324e30f0f2
1 parent a0fa13c commit 66f8194

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

third-party/squangle/src/squangle/mysql_client/mysql_protocol/MysqlFetchOperationImpl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ void MysqlFetchOperationImpl::actionable() {
163163
// - CompleteQuery: an error occurred or rows finished to fetch
164164
// - WaitForConsumer: in case `pause` is called during `notifyRowsReady`
165165
if (active_fetch_action_ == FetchAction::Fetch) {
166-
DCHECK(current_row_stream_.has_value());
166+
if (!current_row_stream_) {
167+
active_fetch_action_ = FetchAction::CompleteQuery;
168+
continue;
169+
}
170+
167171
// Try to catch when the user didn't pause or consumed the rows
168172
if (current_row_stream_->getCurrentRow().has_value()) {
169173
// This should help

0 commit comments

Comments
 (0)