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

LOAD DATA LOCAL INFILE not supported anymore

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.4
    • 3.0.5
    • Other
    • None
    • MariaDB 10.4.18 Docker Image

    Description

      Using MariaDB Java Client version 3.0.4 (and latest Spring Data JPA/Hibernate), we get following exception:

      org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [LOAD DATA LOCAL INFILE 'xyz.csv' INTO TABLE xyz CHARACTER SET cp850 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n';]; nested exception is java.sql.SQLSyntaxErrorException: (conn=8) The used command is not allowed with this MariaDB version
      	at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:93)
      	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
      	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
      	at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541)
      	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
      	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:558)
      	at c.x.y.z.XYZDatabaseService.loadIntoTable(XYZDatabaseService.java:100)
      	...
      Caused by: java.sql.SQLSyntaxErrorException: (conn=8) The used command is not allowed with this MariaDB version
      	at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:270)
      	at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:358)
      	at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:133)
      	at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:815)
      	at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:754)
      	at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:673)
      	at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:616)
      	at org.mariadb.jdbc.Statement.executeInternal(Statement.java:906)
      	at org.mariadb.jdbc.Statement.executeUpdate(Statement.java:888)
      	at org.mariadb.jdbc.Statement.executeUpdate(Statement.java:142)
      	at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:119)
      	at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
      	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:546)
      	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:543)
      	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381)

      Was working with MariaDB Java Client 2.7.5 (and all older 2.x versions).

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            pneyer Patrick Neyer
            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.