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

ALTER TABLE .. ALGORITHM=COPY duplicates contents of multiple file table

    XMLWordPrintable

Details

    Description

      If ALTER is performed with COPY algorithm (explicitly or implicitly) on a CONNECT table with (potentially) multiple underlying files, the contents of the underlying file gets duplicated.

      Maybe it would be happening for non-multiple tables too, but MDEV-30909 (COPY algorithm is not supported) doesn't allow to check it.

      INSTALL SONAME 'ha_connect';
       
      let $MYSQLD_DATADIR= `select @@datadir`;
       
      --write_file $MYSQLD_DATADIR/test/num1.csv
      1
      2
      EOF
       
      CREATE TABLE t (a int NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='num?.csv' MULTIPLE=1;
      SELECT * FROM t;
      ALTER TABLE t FORCE;
      SELECT * FROM t;
       
      ALTER TABLE t FORCE, ALGORITHM=COPY;
      SELECT * FROM t;
       
      --echo # File contents
      --cat_file $MYSQLD_DATADIR/test/num1.csv
       
      # Cleanup
      DROP TABLE t;
      UNINSTALL SONAME 'ha_connect';
      

      10.4 ff3d4395

      ALTER TABLE t FORCE;
      Warnings:
      Warning	1105	This is an outward table, table data were not modified.
      SELECT * FROM t;
      a
      1
      2
      ALTER TABLE t FORCE, ALGORITHM=COPY;
      SELECT * FROM t;
      a
      1
      2
      1
      2
      # File contents
      1
      2
      1
      2
      

      Attachments

        Activity

          People

            TheLinuxJedi Andrew Hutchings
            elenst Elena Stepanova
            Votes:
            0 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.