diff --git a/be/test/olap/row_cursor_test.cpp b/be/test/olap/row_cursor_test.cpp index 3a4ade433ca139..9dd2447e8ff26e 100644 --- a/be/test/olap/row_cursor_test.cpp +++ b/be/test/olap/row_cursor_test.cpp @@ -311,7 +311,7 @@ TEST_F(TestRowCursor, InitRowCursorWithScanKey) { scan_keys.push_back("char_exceed_length"); scan_keys.push_back("varchar_exceed_length"); - std::vector columns{0, 1}; + std::vector columns {0, 1}; std::shared_ptr schema = std::make_shared(tablet_schema.columns(), columns); RowCursor row; @@ -498,7 +498,8 @@ TEST_F(TestRowCursor, AggregateWithoutNull) { agg_update_row(&row, right, nullptr); - int128_t agg_value = *reinterpret_cast(row.cell_ptr(2)); + int128_t agg_value = 0; + memcpy(&agg_value, row.cell_ptr(2), 16); ASSERT_TRUE(agg_value == ((int128_t)(1) << 101)); double agg_double = *reinterpret_cast(row.cell_ptr(3)); @@ -558,7 +559,8 @@ TEST_F(TestRowCursor, AggregateWithNull) { agg_update_row(&row, right, nullptr); - int128_t agg_value = *reinterpret_cast(row.cell_ptr(2)); + int128_t agg_value = 0; + memcpy(&agg_value, row.cell_ptr(2), 16); ASSERT_TRUE(agg_value == ((int128_t)(1) << 101)); bool is_null_double = left.is_null(3);