Skip to content

Connection.getMetaData().getProcedures does not handle schema as a pattern #2336

@snicoll

Description

@snicoll

Driver version

12.6.0.jre11

SQL Server version

2017-latest

Client Operating System

MacOS

JAVA/JVM version

openjdk version "17.0.10" 2024-01-16 LTS

Table schema

A full repro is available here:
https://github.com/ks-no/spring-jdbc-demo

Problem description

The Javadoc of java.sql.DatabaseMetaData#getProcedures states that the schema and procedureName parameters are pattern and not exact match, just like its sibbling getFunctions.

Looking at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData, those parameters seem to be handled as patterns using the escapeIDName method. However the sames arguments for getProcedures are not.

Expected behavior

Searching for a procedure using some\_schema should search for exactly some_schema (and not any character between some and schema).

Actual behavior

If the pattern character is escaped using the escape character, the search does not succeed.

See also spring-projects/spring-framework#32295

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Closed Issues

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions