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

Prepare Statement doesn't remove { } characters

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0-RC
    • Other
    • None
    • Linux

    Description

      This is issue shows up when MariaDB connector is used with EclipseLink.
      EclipseLink is a JPA 2.0 implementation and allows calling a stored procedure. It works fine with MySQL connector, where it creates correctly sp call based on provided class. However, when MariaDB connector is used all calls to SP fails, this happens due to the fact that EclipseLink (platform->MySQLPlatform) sends a prepare request with a text like

      { CALL sp() }. prepareCall method correctly removes {} brackets from a provided text and produces a correct query, however, and prepareStatement method doesn't call escape on a text provided and as the result call DB with a text { CALL sp() }

      .
      The request fails with an error:
      Internal Exception: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '

      { CALL sp_list() }' at line 1
      Query is : { CALL sp_list() }

      Error Code: 1064
      Call:

      { CALL sp_list() }

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            leonidkogan Leonid Kogan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.