Skip to content

Commit 7bff6d0

Browse files
committed
fix out of range
1 parent b6a99f1 commit 7bff6d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/query/pipeline/sources/src/processors/sources/input_formats/input_format_text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ impl<T: InputFormatTextBase> AligningState<T> {
197197
rows.push(i + 1 + size_last_remain)
198198
}
199199
}
200-
let batch_end = rows[rows.len() - 1] - size_last_remain;
201200
if rows.is_empty() {
202201
self.tail_of_last_batch.extend_from_slice(buf);
203202
vec![]
204203
} else {
204+
let batch_end = rows[rows.len() - 1] - size_last_remain;
205205
output.data = mem::take(&mut self.tail_of_last_batch);
206206
output.data.extend_from_slice(&buf[..batch_end]);
207207
self.tail_of_last_batch.extend_from_slice(&buf[batch_end..]);

0 commit comments

Comments
 (0)