[MDEV-9103] Altering table comment does a full copy Created: 2015-11-09  Updated: 2016-04-07  Resolved: 2016-02-15

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 10.1.8, 10.0, 10.1
Fix Version/s: 10.0.24, 10.1.12

Type: Bug Priority: Major
Reporter: Bala Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: upstream
Environment:

10.1.8-MariaDB-1~precise mariadb.org binary distribution (ubuntu)


Issue Links:
Relates
relates to MDEV-9868 Altering a partitioned table comment ... Closed
relates to MDEV-9168 altering a column comment does a full... Closed
Sprint: 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



 Comments   
Comment by Elena Stepanova [ 2015-11-09 ]

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.

Comment by Bala [ 2015-11-11 ]

Yes. We are using MyISAM with partitioning.

Comment by Bala [ 2016-04-04 ]

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

Comment by Elena Stepanova [ 2016-04-04 ]

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.

Comment by Sergei Golubchik [ 2016-04-04 ]

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.

Comment by Bala [ 2016-04-05 ]

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

Comment by Sergei Golubchik [ 2016-04-06 ]

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.

Comment by Bala [ 2016-04-06 ]

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

Generated at Thu Feb 08 07:32:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.