Skip to content

Commit c489a6a

Browse files
committed
fix: fix native internal column bug
1 parent 9ca36e6 commit c489a6a

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/query/storages/fuse/src/operations/mutation/mutation_fill_internal_columns.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ impl Processor for FillInternalColumnProcessor {
102102
}
103103

104104
fn process(&mut self) -> Result<()> {
105-
if let Some((block_meta, data_block)) = self.data_blocks.front_mut() {
105+
if let Some((block_meta, data_block)) = self.data_blocks.pop_front() {
106+
let mut data_block = data_block;
106107
let num_rows = data_block.num_rows();
107108
let internal_column_meta = InternalColumnMeta {
108109
segment_id: block_meta.segment_id,
109110
block_id: block_meta.block_id,
110111
block_location: block_meta.block_location.clone(),
111112
segment_location: block_meta.segment_location.clone(),
112-
snapshot_location: block_meta.snapshot_location.clone().unwrap(),
113+
snapshot_location: block_meta.snapshot_location.unwrap(),
113114
};
114115
for internal_column in self.internal_columns.values() {
115116
let column =
@@ -121,8 +122,6 @@ impl Processor for FillInternalColumnProcessor {
121122
data_block.columns().to_vec(),
122123
data_block.num_rows(),
123124
));
124-
125-
self.data_blocks.pop_front();
126125
}
127126
Ok(())
128127
}

tests/sqllogictests/suites/base/00_dummy/05_0031_internal_column

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ statement ok
2020
INSERT INTO TABLE `05_0031_t` values(3)
2121

2222
query II
23-
SELECT a,_row_id FROM `05_0031_t` order by _row_id
23+
SELECT _row_id,a FROM `05_0031_t` order by _row_id
2424
----
25-
1 0
26-
2 1
27-
3 4194304
25+
0 1
26+
1 2
27+
4194304 3
2828

2929
query II
3030
SELECT a,_row_id FROM `05_0031_t` where _row_id = 0

0 commit comments

Comments
 (0)