Skip to content

Commit 29f6adb

Browse files
committed
add test for old code can't scan to uuid type
1 parent c3bd121 commit 29f6adb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/integration/database_sql_regression_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,28 @@ SELECT CAST($val AS UUID)`,
245245
err := row.Scan(&res)
246246
require.Error(t, err)
247247
})
248+
t.Run("old-receive-to-uuid", func(t *testing.T) {
249+
// test old behavior - for test way of safe work with data, written with bagged API version
250+
var (
251+
scope = newScope(t)
252+
db = scope.SQLDriver()
253+
)
254+
255+
idString := "6E73B41C-4EDE-4D08-9CFB-B7462D9E498B"
256+
row := db.QueryRow(`
257+
DECLARE $val AS Text;
258+
259+
SELECT CAST($val AS UUID)`,
260+
sql.Named("val", idString),
261+
)
262+
263+
require.NoError(t, row.Err())
264+
265+
var res uuid.UUID
266+
267+
err := row.Scan(&res)
268+
require.Error(t, err)
269+
})
248270
t.Run("old-send-receive", func(t *testing.T) {
249271
// test old behavior - for test way of safe work with data, written with bagged API version
250272
var (

0 commit comments

Comments
 (0)