Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-6095

cpimport discards the last character from the csv file if it does not end with \n

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • cpimport
    • None

    Description

      The problem occurs when cpimport is called with the -m 1 arg or a multi-functional setup is used.

      Schema:

      CREATE TABLE t1 (
        col1 INTEGER,
        col2 VARCHAR(255)
      ) Engine=ColumnStore;
      

      Prepare data & invoke import:

      $ for i in $(seq 1 3); do echo $i,test string $i - ok; done > /tmp/t1.csv
      $ echo -n 4,test string 4 - not ok >> /tmp/t1.csv
      $ cpimport -m 1 -s , test t1 /tmp/t1.csv
      

      Result:

      SELECT * FROM t1;
      -- +------+-----------------------+
      -- | col1 | col2                  |
      -- +------+-----------------------+
      -- |    1 | test string 1 - ok    |
      -- |    2 | test string 2 - ok    |
      -- |    3 | test string 3 - ok    |
      -- |    4 | test string 4 - not o |
      -- +------+-----------------------+
      

      Expected result:

      -- +------+------------------------+
      -- |    1 | test string 1 - ok     |
      -- |    2 | test string 2 - ok     |
      -- |    3 | test string 3 - ok     |
      -- |    4 | test string 4 - not ok |
      -- +------+------------------------+
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            alexey.antipovsky Alexey Antipovsky
            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.