Skip to content

TypeInfoCache log statement incorrectly quoted #2935

@buerkle

Description

@buerkle

Please read https://stackoverflow.com/help/minimal-reproducible-example

Describe the issue
The log statement

LOGGER.log(Level.FINEST, "querying SQL typecode for pg type oid '{0}'", intOidToLong(typeOid));
incorrectly quotes the "{0}" parameter. It needs doubled single quotes, otherwise the parameter is not replaced.

Driver Version?
42.5.0

Java Version?
OpenJDK 17

OS Version?
N/A

PostgreSQL Version?
N/A

To Reproduce
Steps to reproduce the behaviour:

  1. Enable FINEST log level for org.postgresql.jdbc.TypeInfoCache
  2. Run a query to trigger cache lookup

Expected behaviour
I expected the log entry to contain the valueof the oid.

The log did not replace the parameter and instead outputted "querying SQL typecode for pg type oid {0}"

Solution
Change the log parameter to use doubled single quotes around the parameter.

LOGGER.log(Level.FINEST, "querying SQL typecode for pg type oid ''{0}''", intOidToLong(typeOid));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions