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

LDI followed by INSERT SELECT statements with cpimport disabled returns incorrect results

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 1.4.3
    • Icebox
    • MDB Plugin
    • None

    Description

      When cpimport is disabled, and the user executes an LDI followed by a few INSERT SELECT statements, with one of the INSERT SELECTS on self, the inserted data is incorrect. Here are steps to reproduce:

      MariaDB [dml]> set columnstore_use_import_for_batchinsert=off;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [dml]> DROP TABLE IF EXISTS cache1;
      Query OK, 0 rows affected (0.360 sec)
       
      MariaDB [dml]> CREATE TABLE cache1 (a int, b varchar(44))engine=columnstore;
      Query OK, 0 rows affected (0.475 sec)
       
      MariaDB [dml]> \! rm -f /tmp/columnstore_cache_data.txt
      MariaDB [dml]> SELECT l_orderkey, l_comment FROM lineitem LIMIT 501 INTO OUTFILE '/tmp/columnstore_cache_data.txt' FIELDS TERMINATED BY ',' ENCLOSED BY '"';
      Query OK, 501 rows affected, 1 warning (0.232 sec)
       
      MariaDB [dml]> LOAD DATA LOCAL INFILE '/tmp/columnstore_cache_data.txt' INTO TABLE cache1 FIELDS TERMINATED BY ',' ENCLOSED BY '"';
      Query OK, 501 rows affected (0.236 sec)              
      Records: 501  Deleted: 0  Skipped: 0  Warnings: 0
       
      MariaDB [dml]> SELECT COUNT(*) FROM cache1;
      +----------+
      | COUNT(*) |
      +----------+
      |      501 |
      +----------+
      1 row in set (0.042 sec)
       
      MariaDB [dml]> DELETE FROM cache1;
      Query OK, 501 rows affected (0.158 sec)
       
      MariaDB [dml]> DROP TABLE IF EXISTS cache_inno1;
      Query OK, 0 rows affected (0.012 sec)
       
      MariaDB [dml]> CREATE TABLE cache_inno1 (a int, b varchar(44));
      Query OK, 0 rows affected (0.015 sec)
       
      MariaDB [dml]> INSERT INTO cache_inno1 VALUES (1, 'a'), (2, 'b');
      Query OK, 2 rows affected (0.003 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [dml]> INSERT INTO cache1 SELECT * FROM cache_inno1;
      Query OK, 2 rows affected (0.174 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [dml]> INSERT INTO cache1 SELECT * FROM cache1;
      Query OK, 2 rows affected (0.221 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [dml]> SELECT * FROM cache1;
      +------+----------+
      | a    | b        |
      +------+----------+
      |    1 | a        |
      |    2 | b        |
      |    1 | _CpNoTf_ |
      |    2 | _CpNoTf_ |
      +------+----------+
      4 rows in set (0.015 sec)
       
      MariaDB [dml]> INSERT INTO cache1 SELECT * FROM cache1;
      Query OK, 4 rows affected (0.192 sec)
      Records: 4  Duplicates: 0  Warnings: 0
       
      MariaDB [dml]> SELECT * FROM cache1;
      +------+----------+
      | a    | b        |
      +------+----------+
      |    1 | a        |
      |    2 | b        |
      |    1 | _CpNoTf_ |
      |    2 | _CpNoTf_ |
      |    1 | NULL     |
      |    2 | NULL     |
      |    1 | NULL     |
      |    2 | NULL     |
      +------+----------+
      8 rows in set (0.016 sec)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            tntnatbry Gagan Goel (Inactive)
            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.