Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
Description
Column type changes in ALGORITHM=INPLACE should set the flag ALTER_COLUMN_TYPE (or ALTER_STORED_COLUMN_TYPE), but MariaDB fails to do that:
--source include/have_innodb.inc
|
create table a(a double) engine=innodb; |
insert into a values(1.15); |
alter table a modify a double(4,4), algorithm=copy; |
alter table a modify a double(4,4), algorithm=inplace; |
drop table a; |
The ALGORITHM=COPY operation would return warnings or errors.
The ALGORITHM=INPLACE operation is wrongly executed as a schema-only change, with no warning or error.
I debugged the execution in MariaDB 10.2, and we had ha_alter_info->handler_flags == ALTER_COLUMN_DEFAULT passed to ha_innobase::check_if_supported_inplace_alter() even though there is no change to any DEFAULT value. (InnoDB would ignore any changes to DEFAULT, because that is completely managed by the SQL layer.)
Changing the constraints of data types should set the ALTER_COLUMN_TYPE flag, which would cause InnoDB to refuse ALGORITHM=INPLACE operation. (Note: changing the AUTO_INCREMENT attribute does this; see MDEV-12836.)