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 <chris@commercesignals.com>
[#649]
  • Loading branch information
chrischall authored Oct 2, 2024
1 parent 6a8b111 commit 04c50f3
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 04c50f3

Please sign in to comment.