From 04c50f31815e2b669862c883e0d659505d34325f Mon Sep 17 00:00:00 2001 From: chrischall Date: Wed, 2 Oct 2024 04:23:01 -0400 Subject: [PATCH] Only get oid and typarray when extension is supported. Co-authored-by: Chris Hall [#649] --- .../java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java b/src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java index e8b9e1f8..bdc4ab84 100644 --- a/src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java +++ b/src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java @@ -104,12 +104,12 @@ public Publisher register(PostgresqlConnection connection, ByteBufAllocato return statement.execute() .flatMap(it -> it.map((row, rowMetadata) -> { - int oid = PostgresqlObjectId.toInt(row.get("oid", Long.class)); - int typarray = rowMetadata.contains("typarray") ? PostgresqlObjectId.toInt(row.get("typarray", Long.class)) : PostgresTypes.NO_SUCH_TYPE; String typname = row.get("typname", String.class); BuiltinCodec lookup = BuiltinCodec.lookup(typname); if (lookup.isSupported()) { + int oid = PostgresqlObjectId.toInt(row.get("oid", Long.class)); + int typarray = rowMetadata.contains("typarray") ? PostgresqlObjectId.toInt(row.get("typarray", Long.class)) : PostgresTypes.NO_SUCH_TYPE; lookup.createCodec(byteBufAllocator, oid, typarray).forEach(registry::addLast); }