Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33712

LOAD DATA LOCAL INFILE not working with comments or CONCAT in SQL statements

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.3.2, 11.4.1
    • None
    • None
    • Win11

    Description

      When attempting to use the SQL command LOAD DATA LOCAL INFILE with comments (-- or #) or with CONCAT function in SQL statements, the operation fails to execute as expected. The issue is reproducible when trying to load data from a CSV file into a database table using the LOAD DATA LOCAL INFILE command.

      Steps to Reproduce:

      Write a SQL script containing the LOAD DATA LOCAL INFILE command.
      Include a comment (-- or #) or use CONCAT function within the SQL script.
      Execute the SQL script against a database.
      Observe that the LOAD DATA LOCAL INFILE command fails to execute properly when comments or CONCAT function are present.

      Example Code:

      --commment OR #comment
      LOAD DATA LOCAL INFILE 'C:Example.csv'
      INTO TABLE example

      I tried somethings out noticed that if you use LOAD DATA LOCAL INFILE with CONCAT it wont work aswell. Reason might be the same, cant really tell. Then when you instead use LOAD DATA INFILE it works perfectly. Client and Server are configurered that they accept LOAD DATA LOCAL INFILE

      Workaround:
      Temporarily remove the comments or CONCAT function from the SQL script to execute the LOAD DATA LOCAL INFILE command successfully. Or switch to LOAD DATA INFILE

      Attachments

        Activity

          People

            Unassigned Unassigned
            Fable Gabriel Di Palma
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.