Skip to content

Commit e6a3509

Browse files
pnv1Gazizonoki
authored andcommitted
Add validation before trying to read a query result (#26317)
1 parent 71d513c commit e6a3509

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/last_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
337ad331d577c2bf3d4e92fb73a77dc37cf8fc7f
1+
8ca586a7fefca64794ea9ae26aed6c720d216d32

src/client/query/impl/exec_query.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ class TExecuteQueryIterator::TReaderImpl {
128128
};
129129

130130
TAsyncExecuteQueryPart TExecuteQueryIterator::ReadNext() {
131+
if (!ReaderImpl_) {
132+
RaiseError("Attempt to read a stream result part on an invalid stream. ");
133+
}
134+
131135
if (ReaderImpl_->IsFinished()) {
132-
RaiseError("Attempt to perform read on invalid or finished stream");
136+
RaiseError("Attempt to read a stream result part on a finished stream. ");
133137
}
134138

135139
return ReaderImpl_->ReadNext(ReaderImpl_);

0 commit comments

Comments
 (0)