microsoft / mssql-jdbc

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity with SQL Server through the standard JDBC application program interfaces (APIs).
MIT License
1.04k stars 421 forks source link

Calling a function with parentheses at the end of the function name returns always 0 #2463

Closed SteBoe82 closed 1 day ago

SteBoe82 commented 4 days ago

Driver version

12.6.3

SQL Server version

Microsoft SQL Server 2022 (RTM-CU7) (KB5028743) - 16.0.4065.3 (X64)

Client Operating System

Windows 11 & Ubuntu

JAVA/JVM version

jdk-21.0.1

Table schema

See the example which contains a simple SQL function and a Java test case which calls the function. FunctionTest.zip

Problem description

When calling a function whose name contains parentheses at the end, 0 of type Integer is always returned. In the profiler I could see that the correct value was returned. Testing with driver version '12.6.2' the correct value is returned regardless of whether 'foobar' or 'foobar()' is called.

Expected behavior

The SQL driver returns the correct value as received from the database system

Actual behavior

0 if type Integer is returned

Jeffery-Wasty commented 3 days ago

Hi @SteBoe82,

Thank you for your repro. I'm able to replicate the issue with 12.6.3. We're currently investigating the cause and potential fix, and will get back to you with our results.

Jeffery-Wasty commented 3 days ago

Hi @SteBoe82,

We're aware of where the issue is, and how to fix it. Our question for you is, what is the impact of this bug for your use case? Our GA release is planned for July 31st, and will include a fix for this issue. If you're able to work around the parenthesis issue for the next month, this will save us having to release a hotfix immediately. Let us know your thoughts on this proposition.

SteBoe82 commented 2 days ago

Good morning @Jeffery-Wasty,

For my point of view, it will be enough when the bug fix will be released with the next planned release. We are currently using version 12.6.2 and there is no urgent need to consume the current version immediately. So we need no hotfix.

Thanks a lot :-)

Jeffery-Wasty commented 1 day ago

Fix has been merged, will be available for 12.7.1 Preview (planned in the next week) and 12.8.0 GA Release (July 31).