mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Add test for record with unknown OID
This commit is contained in:
parent
fcf7df042b
commit
21dad60cf7
@ -102,6 +102,28 @@ func TestRecordTranscode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRecordWithUnknownOID(t *testing.T) {
|
||||||
|
conn := testutil.MustConnectPgx(t)
|
||||||
|
defer testutil.MustClose(t, conn)
|
||||||
|
|
||||||
|
_, err := conn.Exec(`drop type if exists floatrange;
|
||||||
|
|
||||||
|
create type floatrange as range (
|
||||||
|
subtype = float8,
|
||||||
|
subtype_diff = float8mi
|
||||||
|
);`)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer conn.Exec("drop type floatrange")
|
||||||
|
|
||||||
|
var result pgtype.Record
|
||||||
|
err = conn.QueryRow("select row('foo'::text, floatrange(1, 10), 'bar'::text)").Scan(&result)
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("expected error but none")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestRecordAssignTo(t *testing.T) {
|
func TestRecordAssignTo(t *testing.T) {
|
||||||
var valueSlice []pgtype.Value
|
var valueSlice []pgtype.Value
|
||||||
var interfaceSlice []interface{}
|
var interfaceSlice []interface{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user