Skip to content

Commit 52a54b9

Browse files
chrischallmp911de
authored andcommitted
Only get oid and typarray when extension is supported.
Co-authored-by: Chris Hall <[email protected]> [#649]
1 parent 5879aef commit 52a54b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ public Publisher<Void> register(PostgresqlConnection connection, ByteBufAllocato
104104
return statement.execute()
105105
.flatMap(it -> it.map((row, rowMetadata) -> {
106106

107-
int oid = PostgresqlObjectId.toInt(row.get("oid", Long.class));
108-
int typarray = rowMetadata.contains("typarray") ? PostgresqlObjectId.toInt(row.get("typarray", Long.class)) : PostgresTypes.NO_SUCH_TYPE;
109107
String typname = row.get("typname", String.class);
110108

111109
BuiltinCodec lookup = BuiltinCodec.lookup(typname);
112110
if (lookup.isSupported()) {
111+
int oid = PostgresqlObjectId.toInt(row.get("oid", Long.class));
112+
int typarray = rowMetadata.contains("typarray") ? PostgresqlObjectId.toInt(row.get("typarray", Long.class)) : PostgresTypes.NO_SUCH_TYPE;
113113
lookup.createCodec(byteBufAllocator, oid, typarray).forEach(registry::addLast);
114114
}
115115

0 commit comments

Comments
 (0)