Skip to content

Commit

Permalink
Only get oid and typarray when extension is supported.
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Hall <[email protected]>
[#649]
  • Loading branch information
chrischall authored and mp911de committed Oct 2, 2024
1 parent 5879aef commit 52a54b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public Publisher<Void> 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);
}

Expand Down

0 comments on commit 52a54b9

Please sign in to comment.