Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.2.3
-
None
Description
Hi there,
we switched from MySQL Connector/J to MariaDB Connector/J recently. Unfortunately we had some issues with our code calling stored procedures. It looks like MySQL Connector/J is more lenient when it comes to validating the curly braces syntax with newlines.
For example the following character sequences work with MySQL Connector/J, but brake in MariaDB Connector/J. Examples are parameters for prepareCall in CallableStatement.
"{call foo(?,\n?) }"
|
"{\n call foo (?, ?)\n }"
|
Maybe this looks better:
{call foo(?,
|
?) }
|
|
{
|
call foo(?,?)
|
}
|
I have no clue how strict the JDBC specifications are with these things, but considering the following queries do work with MariaDB Connector/J, it makes sense to be either lenient in all cases or in none of them.
{call foo(?,?)
|
}
|
|
{call
|
foo(?,?)
|
}
|
New lines break the prepareCall in two cases:
- If there is a newline right after the opening curly brace
- If there is one or more newlines in the argument list (between the brackets).
Both are easy to fix. If it is considered worth fixing. I open a PR, referencing this ticket in Github.
By the way: kudos to the person who wrote the regex CALLABLE_STATEMENT_PATTERN. Thats one impressive regex.
edit Here is the link to the PR: https://github.com/MariaDB/mariadb-connector-j/pull/125