Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: xufei <[email protected]>
  • Loading branch information
windtalker committed Jun 20, 2024
1 parent c4db947 commit 29f60a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/executor/join/hash_join_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ var (

// IsHashJoinV2Enabled return true if hash join v2 is enabled
func IsHashJoinV2Enabled() bool {
// sizeOfUintptr should always equal to sizeOfUnsafePointer, add this check here in case in the future
// go runtime change this
// sizeOfUintptr should always equal to sizeOfUnsafePointer, because according to golang's doc,
// a Pointer can be converted to an uintptr. Add this check here in case in the future go runtime
// change this
return enableHashJoinV2.Load() && sizeOfUintptr >= sizeOfUnsafePointer
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/executor/join/join_row_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func TestFixedOffsetInRowLayout(t *testing.T) {
require.Equal(t, 8, sizeOfLengthField)
}

func TestUintptrCanHoldPointer(t *testing.T) {
require.Equal(t, true, sizeOfUintptr >= sizeOfUnsafePointer)
}

func TestJoinTableMetaKeyMode(t *testing.T) {
tinyTp := types.NewFieldType(mysql.TypeTiny)
intTp := types.NewFieldType(mysql.TypeLonglong)
Expand Down

0 comments on commit 29f60a5

Please sign in to comment.