Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/include/mysql_result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class MySQLResult {

DataChunk &NextChunk();
bool Next();
bool Exhausted();
idx_t AffectedRows();
const vector<MySQLField> &Fields();

Expand Down
4 changes: 4 additions & 0 deletions src/mysql_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ DataChunk &MySQLResult::NextChunk() {
return this->data_chunk;
}

bool MySQLResult::Exhausted() {
return this->exhausted;
}

bool MySQLResult::FetchNext() {
for (auto &f : fields) {
#ifdef DEBUG
Expand Down
5 changes: 5 additions & 0 deletions src/mysql_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ static unique_ptr<LocalTableFunctionState> MySQLInitLocalState(ExecutionContext

static void MySQLScan(ClientContext &context, TableFunctionInput &data, DataChunk &output) {
auto &gstate = data.global_state->Cast<MySQLGlobalState>();
if (gstate.result->Exhausted()) {
output.SetCardinality(0);
return;
}

DataChunk &res_chunk = gstate.result->NextChunk();
D_ASSERT(output.ColumnCount() == res_chunk.ColumnCount());
string error;
Expand Down
Loading