Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyass committed Dec 10, 2023
1 parent 7094810 commit 0b3fa36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/query/catalog/src/plan/internal_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl InternalColumn {
pub fn virtual_computed_expr(&self) -> Option<String> {
match &self.column_type {
InternalColumnType::ChangeRowId => Some(
"sha1(if(is_not_null(_origin_block_id), concat(to_uuid(_origin_block_id), hex(_origin_block_row_num)), _base_row_id))"
"if(is_not_null(_origin_block_id), concat(to_uuid(_origin_block_id), lpad(hex(_origin_block_row_num), 6, '0')), _base_row_id)"
.to_string(),
),
_ => None,
Expand Down Expand Up @@ -276,12 +276,12 @@ impl InternalColumn {
let mut row_ids = Vec::with_capacity(num_rows);
if let Some(offsets) = &meta.offsets {
for i in offsets {
let row_id = format!("{}{:x}", uuid, *i).as_bytes().to_vec();
let row_id = format!("{}{:06x}", uuid, *i).as_bytes().to_vec();
row_ids.push(row_id);
}
} else {
for i in 0..num_rows {
let row_id = format!("{}{:x}", uuid, i).as_bytes().to_vec();
let row_id = format!("{}{:06x}", uuid, i).as_bytes().to_vec();
row_ids.push(row_id);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/suites/5_ee/05_stream/05_0000_ee_stream.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1
2 INSERT 0 1
true
2 INSERT false true
test_s default default db_stream.t
test_s default default db_stream.t NULL test append_only
test_s default default db_stream.t NULL test append_only
4 changes: 2 additions & 2 deletions tests/suites/5_ee/05_stream/05_0000_ee_stream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ echo "create stream default.test_s on table db_stream.t comment = 'test'" | $BEN
echo "insert into db_stream.t values(2)" | $BENDSQL_CLIENT_CONNECT

BASE_ROW_ID=$(echo "select _base_row_id from default.test_s" | $BENDSQL_CLIENT_CONNECT)
echo "select change\$row_id=$BASE_ROW_ID from default.test_s" | $BENDSQL_CLIENT_CONNECT
echo "select change\$row_id='$BASE_ROW_ID' from default.test_s" | $BENDSQL_CLIENT_CONNECT
echo "optimize table db_stream.t compact" | $BENDSQL_CLIENT_CONNECT
echo "select a, change\$action, change\$is_update, change\$row_id=$BASE_ROW_ID from default.test_s" | $BENDSQL_CLIENT_CONNECT
echo "select a, change\$action, change\$is_update, change\$row_id='$BASE_ROW_ID' from default.test_s" | $BENDSQL_CLIENT_CONNECT

echo "show streams like 'test_s'" | $BENDSQL_CLIENT_CONNECT | awk '{print $(NF-3), $(NF-2), $(NF-1), $NF}'
echo "show full streams like 'test_s'" | $BENDSQL_CLIENT_CONNECT | awk '{print $(NF-6), $(NF-5), $(NF-4), $(NF-3), $(NF-2), $(NF-1), $NF}'
Expand Down

0 comments on commit 0b3fa36

Please sign in to comment.