Skip to content

Commit

Permalink
Add UUID_TO_BIN integration test.
Browse files Browse the repository at this point in the history
  • Loading branch information
go-jet committed Feb 27, 2024
1 parent 4094029 commit 16d0e57
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/mysql/select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1692,3 +1692,26 @@ FROM dvds.actor;
require.NoError(t, err)
require.Len(t, actors, 200)
}

func TestUUIDFunctions(t *testing.T) {

stmt := SELECT(
UUID_TO_BIN(String("4255e382-1c10-4ac0-ba5b-039ca7a8525f")).AS("bin"),
)

testutils.AssertDebugStatementSql(t, stmt, `
SELECT uuid_to_bin('4255e382-1c10-4ac0-ba5b-039ca7a8525f') AS "bin";
`)

var dest struct {
Bin []byte
}

err := stmt.Query(db, &dest)
require.NoError(t, err)
testutils.AssertJSON(t, dest, `
{
"Bin": "QlXjghwQSsC6WwOcp6hSXw=="
}
`)
}

0 comments on commit 16d0e57

Please sign in to comment.