After switching the database driver from mysql-connector-java
to mariadb-java-client
in one of our applications, stored procedures called with SimpleJdbcCall
no longer worked and failed with an exception like java.sql.SQLSyntaxErrorException: Incorrect number of arguments for PROCEDURE foo.bar; expected 12, got 0
.
After some investigation I noticed that the CallMetaDataProviderFactory
has a list called supportedDatabaseProductsForProcedures
(which contains MySQL
, but not MariaDB
) so accessProcedureColumnMetaData
was set to false
and initializeWithProcedureColumnMetaData
was not called on the CallMetaDataProvider
; thus no parameters where added to the procedure call, resulting in the SQLSyntaxErrorException
.
So I think MariaDB
should be added to the supportedDatabaseProductsForProcedures
.
Comment From: jhoeller
As with #24443, we're going to add this to 5.2.x (5.2.10) and also backport it to 5.1.x (5.1.19). Thanks for raising it!
Comment From: jhoeller
As pointed out in https://github.com/spring-projects/spring-framework/commit/392ad0999076ed1158ba9139a0a71e5a298474de, we should add MariaDB to supportedDatabaseProductsForFunctions
(since MySQL is also there).