Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit f52dbbf

Browse files
authored
fix skipped test returning empty result set in hrana (#463)
1 parent c318af6 commit f52dbbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sqld/src/hrana/result_builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ pub struct HranaBatchProtoBuilder {
220220
stmt_builder: SingleStatementBuilder,
221221
current_size: u64,
222222
max_response_size: u64,
223+
step_empty: bool,
223224
}
224225

225226
impl QueryResultBuilder for HranaBatchProtoBuilder {
@@ -235,6 +236,7 @@ impl QueryResultBuilder for HranaBatchProtoBuilder {
235236
}
236237

237238
fn begin_step(&mut self) -> Result<(), QueryResultBuilderError> {
239+
self.step_empty = true;
238240
self.stmt_builder.begin_step()
239241
}
240242

@@ -254,7 +256,7 @@ impl QueryResultBuilder for HranaBatchProtoBuilder {
254256
};
255257
match std::mem::replace(&mut self.stmt_builder, new_builder).into_ret() {
256258
Ok(res) => {
257-
self.step_results.push(Some(res));
259+
self.step_results.push((!self.step_empty).then_some(res));
258260
self.step_errors.push(None);
259261
}
260262
Err(e) => {
@@ -276,6 +278,7 @@ impl QueryResultBuilder for HranaBatchProtoBuilder {
276278
&mut self,
277279
cols: impl IntoIterator<Item = impl Into<Column<'a>>>,
278280
) -> Result<(), QueryResultBuilderError> {
281+
self.step_empty = false;
279282
self.stmt_builder.cols_description(cols)
280283
}
281284

0 commit comments

Comments
 (0)