Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] getColumns not escaping Wildcards #1136

Closed
probert94 opened this issue Aug 30, 2019 · 7 comments
Closed

[BUG] getColumns not escaping Wildcards #1136

probert94 opened this issue Aug 30, 2019 · 7 comments
Labels
Bug A bug in the driver. A high priority item that one can expect to be addressed quickly.

Comments

@probert94
Copy link

Driver version

Version 7.3.1 or later

SQL Server version

SQL Server 2017

Client Operating System

Windows 10 x64

JAVA/JVM version

OpenJDK 1.8.0_202

Problem description

  1. Expected behaviour:
    I have a table with a column ID_Article.
    When calling getColumns with ID\_Article as col Parameter, it should return the description of table column ID_Article .

  2. Actual behaviour:
    Since version 7.3.1 it does not seem to find the column anymore, as it does not escape the _ correctly.

  3. Error message/stack trace:
    No error is thrown, it just does not find the column.

  4. Any other details that can be helpful:
    The method EscapeIDName states, that \_n will be mapped to '[_]n' as the SQL-Server expects this syntax. However, this mapping does not seem to occur anymore.
    The bug was probably introduced by Fix | Align DatabaseMetadata.getColumns with JDBC 4.3 Specifications #1016.
    Also [BUG] regression with 7.4.1 (against 7.2.2) #1134 might be related to this.

@probert94 probert94 added the Bug A bug in the driver. A high priority item that one can expect to be addressed quickly. label Aug 30, 2019
@peterbae
Copy link
Contributor

Hi @Springrbua, thanks for contacting us. I've identified the issue and I'm testing my fix. As soon as the internal testings are done, I'll create a PR and provide you with a custom jar that contains my fix.

@peterbae
Copy link
Contributor

peterbae commented Sep 3, 2019

Hi @Springrbua, @mprins, I've made a PR that fixes this issue. I've attached the driver jars with the fix in them (for Java 8/12), so if you have time, please try these and confirm if the fix is good. Thanks!

github-1136-fix.zip

@probert94
Copy link
Author

@peterbae Thank you very much, the patched driver fixed the issue for me.

@dqmdev
Copy link

dqmdev commented Sep 4, 2019

When will MS release the build to customers?

In other words, when will the successor to 7.4.1 be announced at

https://techcommunity.microsoft.com/t5/SQL-Server/bg-p/SQLServer/label-name/SQLServerDrivers

@peterbae
Copy link
Contributor

peterbae commented Sep 4, 2019

We're aiming to release the next preview version of the driver by the end of this month, and it will include this fix.

@mprins
Copy link

mprins commented Sep 5, 2019

I had a chance to test this today, I can not reproduce the problem with the attached, patched driver, even though I don't have columns with underscores, but do have tables with underscores, but that also seems to be adressed in #1138

@ulvii
Copy link
Contributor

ulvii commented Oct 2, 2019

#1138 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the driver. A high priority item that one can expect to be addressed quickly.
Projects
None yet
Development

No branches or pull requests

5 participants