Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-605

Newlines break calling stored procedures

    XMLWordPrintable

    Details

      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:

      1. If there is a newline right after the opening curly brace
      2. 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

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            raupach Björn Raupach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: