Regression - Stored procedure can't be executed - "Parameter {...} was not defined for stored procedure" #2063
Labels
Bug
A bug in the driver. A high priority item that one can expect to be addressed quickly.
Projects
Milestone
Driver version
12.2.0.jre11
SQL Server version
Microsoft Azure SQL Edge Developer (RTM) - 15.0.2000.1565 (ARM64) Jun 14 2022 00:37:12 Copyright (C) 2019 Microsoft Corporation Linux (Ubuntu 18.04.6 LTS aarch64)
Client Operating System
Mac OSX
JAVA/JVM version
org.eclipse.justj.openjdk.hotspot.jre.full.macosx.aarch64_17.0.2.v20220201-1208
Problem description
After upgrading from 11.2.1 to 12.2.0, when executing a stored procedure we get
Parameter {...} was not defined for stored procedure
.This affects multiple different OS and database versions.
From debugging the source code this looks to have been introduced in #1898.
In
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.findColumn(String)
, ametaQuery
is constructed to get information on the stored procedures' columns.In both 11.2.1 & 12.2.0, the
metaQuery
returns no results.The following section then attempts to get a position from
map
- ifparameterNames
wasnull
, previously it would return a value (the next increment ofai
) - whereas now it will only do this ifparameterNames
is non-null
and has exactly one element.Therefore no results are returned, and the query fails.
You can probably see this change more clearly here - fa48f7c
The text was updated successfully, but these errors were encountered: