From 0b3fa3691d6370e60ef3d67ea7113da5bdc107af Mon Sep 17 00:00:00 2001 From: zhyass <34016424+zhyass@users.noreply.github.com> Date: Sun, 10 Dec 2023 09:41:28 +0800 Subject: [PATCH] fix --- src/query/catalog/src/plan/internal_column.rs | 6 +++--- tests/suites/5_ee/05_stream/05_0000_ee_stream.result | 4 ++-- tests/suites/5_ee/05_stream/05_0000_ee_stream.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/query/catalog/src/plan/internal_column.rs b/src/query/catalog/src/plan/internal_column.rs index 6caa6ff21e06..d14ecdadc6c4 100644 --- a/src/query/catalog/src/plan/internal_column.rs +++ b/src/query/catalog/src/plan/internal_column.rs @@ -200,7 +200,7 @@ impl InternalColumn { pub fn virtual_computed_expr(&self) -> Option { 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, @@ -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); } } diff --git a/tests/suites/5_ee/05_stream/05_0000_ee_stream.result b/tests/suites/5_ee/05_stream/05_0000_ee_stream.result index efc4b56d18cf..035e21c48d57 100755 --- a/tests/suites/5_ee/05_stream/05_0000_ee_stream.result +++ b/tests/suites/5_ee/05_stream/05_0000_ee_stream.result @@ -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 diff --git a/tests/suites/5_ee/05_stream/05_0000_ee_stream.sh b/tests/suites/5_ee/05_stream/05_0000_ee_stream.sh index fcba56ca7148..220f46f433b2 100755 --- a/tests/suites/5_ee/05_stream/05_0000_ee_stream.sh +++ b/tests/suites/5_ee/05_stream/05_0000_ee_stream.sh @@ -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}'