Skip to content

Commit c3277cb

Browse files
committed
added test for BAD_REQUEST
1 parent dc28966 commit c3277cb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/integration/database_sql_regression_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,24 @@ func TestUUIDSerializationDatabaseSQLIssue1501(t *testing.T) {
347347

348348
require.Equal(t, id, resUUID)
349349
})
350+
t.Run("old-send-uuid-receive-error-bad-request", func(t *testing.T) {
351+
var (
352+
scope = newScope(t)
353+
db = scope.SQLDriver()
354+
)
355+
356+
idString := "6E73B41C-4EDE-4D08-9CFB-B7462D9E498B"
357+
id := uuid.MustParse(idString)
358+
row := db.QueryRow(`
359+
DECLARE $val AS Utf8;
360+
SELECT $val`,
361+
sql.Named("val", id), // send as string because uuid implements Value() (driver.Value, error)
362+
)
363+
364+
require.Error(t, row.Err())
365+
require.True(t, xerrors.IsOperationError(row.Err(), Ydb.StatusIds_BAD_REQUEST))
366+
require.ErrorContains(t, row.Err(), "Parameter $val type mismatch, expected:")
367+
})
350368
t.Run("good-send", func(t *testing.T) {
351369
var (
352370
scope = newScope(t)

0 commit comments

Comments
 (0)