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

MariaDbClientPreparedStatement - syntax error on insert values

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4.0, 1.3.7, 1.4.1, 1.4.2
    • 1.4.3
    • Other
    • None
    • Windows\linux connecting to MySQL 5.5.X

    Description

      When either by configuration of "useServerPrepStmts=false"
      Or when MariaDbServerPreparedStatement.prepare has failed (the reason here does not matter , probably because of high load)
      and the MariaDbConnection fallback is MariaDbClientPreparedStatement.

      a query such as "INSERT INTO mytable VALUES (?,?) , (?,?)"
      is broken down to the following query parts (using function createRewritableParts):
      [0] INSERT INTO mytable VALUES
      [1] (
      [2] ,
      [3] )
      [4] ,(
      [5] ,
      [6] )

      this results in the final query to be sent as:
      INSERT INTO mytable VALUES ( param[0],param[1])param[3],(param[4],)

      results in syntax error.

      i have checked the older code of version 1.1.8 (before 1.3.0, and 1.1.8 is the version i used before)

      in that version in class MySQLParameterizedQuery the createQueryParts
      breaks down the query like this:

      [0] INSERT INTO mytable VALUES (
      [1] ,
      [2] ),(
      [3] ,
      [4] )

      and then the query is sent correctly to the DB

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              orgerson or gerson
              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.