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

Altering table comment does a full copy

Details

    • 10.0.24

    Description

      MariaDB [test]> alter online table test comment = 'Test', ALGORITHM=INPLACE;
      ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.

      This is a partitioned table. But, as per the documentation https://mariadb.com/kb/en/mariadb/alter-table/ , this operation should happen instantly.

      Please let me know if you need further information.

      Thanks.

      -Bala

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - - edited

            bala.linux, are you using MyISAM engine for the table?

            For now I'll assume you are.

            --source include/have_partition.inc
             
            create table t1 (i int) engine=MyISAM partition by hash(i) partitions 2;
            alter table t1 comment 'test', algorithm=inplace;
            drop table t1;

            MariaDB [test]> alter table t1 comment 'test', algorithm=inplace;
            ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.

            Works okay with InnoDB and without partitioning.
            Reproducible on MySQL 5.6.10, but apparently it was fixed in MySQL 5.6.11 – the release notes have this:

            Partitioning: ALGORITHM = INPLACE, which was disallowed in MySQL 5.6.10 for DDL statements operating on partitioned tables, can once again be used with such statements. (Bug #16216513)

            References: See also Bug #14760210.

            Maybe we got the InnoDB part of the fix with regular InnoDB merges, but MyISAM still has the problem.

            elenst Elena Stepanova added a comment - - edited bala.linux , are you using MyISAM engine for the table? For now I'll assume you are. --source include/have_partition.inc   create table t1 (i int) engine=MyISAM partition by hash(i) partitions 2; alter table t1 comment 'test', algorithm=inplace; drop table t1; MariaDB [test]> alter table t1 comment 'test', algorithm=inplace; ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. Works okay with InnoDB and without partitioning. Reproducible on MySQL 5.6.10, but apparently it was fixed in MySQL 5.6.11 – the release notes have this: Partitioning: ALGORITHM = INPLACE, which was disallowed in MySQL 5.6.10 for DDL statements operating on partitioned tables, can once again be used with such statements. (Bug #16216513) References: See also Bug #14760210. Maybe we got the InnoDB part of the fix with regular InnoDB merges, but MyISAM still has the problem.
            bala.linux Bala added a comment -

            Yes. We are using MyISAM with partitioning.

            bala.linux Bala added a comment - Yes. We are using MyISAM with partitioning.
            bala.linux Bala added a comment - - edited

            Team,

            Looks like this hasn't got fixed yet. I tried the test case from comment #1 and it failed to work. Please check.

            mysql> show variables like '%version%';
            +-------------------------+---------------------------------+
            | Variable_name           | Value                           |
            +-------------------------+---------------------------------+
            | innodb_version          | 5.6.28-76.1                     |
            | protocol_version        | 10                              |
            | slave_type_conversions  |                                 |
            | version                 | 10.0.24-MariaDB-1~trusty        |
            | version_comment         | mariadb.org binary distribution |
            | version_compile_machine | x86_64                          |
            | version_compile_os      | debian-linux-gnu                |
            | version_malloc_library  | bundled jemalloc                |
            +-------------------------+---------------------------------+
            8 rows in set (0.00 sec)
             
            mysql> create table t1 (i int) engine=MyISAM partition by hash(i) partitions 2;
            Query OK, 0 rows affected (0.00 sec)
             
            mysql> alter table t1 comment 'test', algorithm=inplace;
            ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
            mysql>
            

            Thanks.

            -Bala

            bala.linux Bala added a comment - - edited Team, Looks like this hasn't got fixed yet. I tried the test case from comment #1 and it failed to work. Please check. mysql> show variables like '%version%'; +-------------------------+---------------------------------+ | Variable_name | Value | +-------------------------+---------------------------------+ | innodb_version | 5.6.28-76.1 | | protocol_version | 10 | | slave_type_conversions | | | version | 10.0.24-MariaDB-1~trusty | | version_comment | mariadb.org binary distribution | | version_compile_machine | x86_64 | | version_compile_os | debian-linux-gnu | | version_malloc_library | bundled jemalloc | +-------------------------+---------------------------------+ 8 rows in set (0.00 sec)   mysql> create table t1 (i int) engine=MyISAM partition by hash(i) partitions 2; Query OK, 0 rows affected (0.00 sec)   mysql> alter table t1 comment 'test', algorithm=inplace; ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. mysql> Thanks. -Bala

            serg, see above ^
            I see the commit related to this bug report, but maybe you only pushed a part of the patch? I don't see the test case for MyISAM/partition there.

            elenst Elena Stepanova added a comment - serg , see above ^ I see the commit related to this bug report, but maybe you only pushed a part of the patch? I don't see the test case for MyISAM/partition there.

            bala.linux, you're right. This was fixed only for not partitioned table. I'm sorry for this.
            I've now created a new MDEV-9868 specifically for partitioned tables, it will be fixed in the next release.

            serg Sergei Golubchik added a comment - bala.linux , you're right. This was fixed only for not partitioned table. I'm sorry for this. I've now created a new MDEV-9868 specifically for partitioned tables, it will be fixed in the next release.
            bala.linux Bala added a comment - - edited

            Thanks. Also, would it be possible to do something similar for altering "column" comments ? It does the full copy too. I created MDEV-9168 but never got any attention. Please let me know.

            -Bala

            bala.linux Bala added a comment - - edited Thanks. Also, would it be possible to do something similar for altering "column" comments ? It does the full copy too. I created MDEV-9168 but never got any attention. Please let me know. -Bala

            MDEV-9168 is a Task listing two distinct issues: the awkward syntax and a full table copy.
            If you'd like I can convert it to a Bug about full table copy when altering column comments.
            Alternatively, you can create a new bug report for the latter and keep the task to deal with the awkward syntax.

            serg Sergei Golubchik added a comment - MDEV-9168 is a Task listing two distinct issues: the awkward syntax and a full table copy. If you'd like I can convert it to a Bug about full table copy when altering column comments. Alternatively, you can create a new bug report for the latter and keep the task to deal with the awkward syntax.
            bala.linux Bala added a comment - - edited

            Yes. Please convert it to a bug to track "full table copy when altering column comments". I created a new bug for the awkward syntax (MDEV-9878).

            Thanks.

            -Bala

            bala.linux Bala added a comment - - edited Yes. Please convert it to a bug to track "full table copy when altering column comments". I created a new bug for the awkward syntax ( MDEV-9878 ). Thanks. -Bala

            People

              serg Sergei Golubchik
              bala.linux Bala
              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.