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

regression in 3.x.y: parameterized batch in multiquery mode "SET @name := ?; INSERT INTO products( name ) VALUES ( @name )" fails

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.1.2
    • None
    • 2.7 compatibility
    • None
    • win10pro[64bit], 10.5.4-MariaDB, java8

    Description

      regression.
      2.7.x connector works, 3.x.y connector fails to execute parameterized batch of statements in multiquery mode [in connection url: allowMultiQueries=true]
      "SET @name := ?; INSERT INTO products( name ) VALUES ( @name )".

      OUTPUT when fails with connector driver ver. 3.1.2:

       running:
        SELECT version() as serverVersion
       Server version: [{serverVersion=10.5.4-MariaDB}]
       Driver version: 3.1.2
       running:
        DROP TABLE IF EXISTS products
       running:
        CREATE TABLE IF NOT EXISTS products (
          id       int unsigned AUTO_INCREMENT NOT NULL,
          name     varchar( 100 ) NOT NULL,
          created  datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
          PRIMARY KEY ( id )
        ) DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci
       running batch:
        SET @name := ?;
        INSERT INTO products( name ) VALUES ( @name )
      [ WARN] (main) Error: 1064-42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO products( name ) VALUES ( @name )' at line 2
      [ WARN] (main) Error: 1243-HY000: Unknown prepared statement handler (4294967295) given to mysqld_stmt_execute
      Exception in thread "main" java.sql.BatchUpdateException: (conn=1356) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO products( name ) VALUES ( @name )' at line 2
      	at org.mariadb.jdbc.export.ExceptionFactory.createBatchUpdate(ExceptionFactory.java:181)
      	at org.mariadb.jdbc.ClientPreparedStatement.executeBatchBulk(ClientPreparedStatement.java:179)
      	at org.mariadb.jdbc.ClientPreparedStatement.executeInternalPreparedBatch(ClientPreparedStatement.java:115)
      	at org.mariadb.jdbc.ClientPreparedStatement.executeBatch(ClientPreparedStatement.java:466)
      	at test.MariaDB_Regression3.runBatch(MariaDB_Regression3.java:88)
      	at test.MariaDB_Regression3.main(MariaDB_Regression3.java:108)
      Caused by: java.sql.BatchUpdateException: (conn=1356) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO products( name ) VALUES ( @name )' at line 2
      	at org.mariadb.jdbc.export.ExceptionFactory.createBatchUpdate(ExceptionFactory.java:215)
      	at org.mariadb.jdbc.client.impl.StandardClient.executePipeline(StandardClient.java:620)
      	at org.mariadb.jdbc.ClientPreparedStatement.executeBatchBulk(ClientPreparedStatement.java:148)
      	... 4 more
      Caused by: java.sql.SQLSyntaxErrorException: (conn=1356) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO products( name ) VALUES ( @name )' at line 2
      	at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:282)
      	at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:370)
      	at org.mariadb.jdbc.message.client.PreparePacket.readPacket(PreparePacket.java:74)
      	at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:855)
      	at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:794)
      	at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:713)
      	at org.mariadb.jdbc.client.impl.StandardClient.executePipeline(StandardClient.java:571)
      	... 5 more
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            dpichugin Dmitriy Pichugin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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