Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.6
Description
To reproduce:
docker run -d -P --name par1 --env MARIADB_ROOT_PASSWORD=Password123! mariadb:latest
|
|
mysql -h127.0.0.1 -uroot -pPassword123! -P32768 |
create database if not exists d1 ; |
|
use d1;
|
drop table if exists t1; |
|
CREATE TABLE t1par (
|
f1 datetime ,
|
f2 VARCHAR(2) , |
f3 VARCHAR(200) NOT NULL , |
f4 VARCHAR(100) charset utf8 |
)
|
/*!50100 PARTITION BY RANGE COLUMNS(f2) (PARTITION p_01 VALUES LESS THAN ('02') ENGINE = InnoDB, PARTITION p_31 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB ) */; |
|
CREATE TABLE t1nopar (
|
f1 datetime ,
|
f2 VARCHAR(2) , |
f3 VARCHAR(200) NOT NULL , |
f4 VARCHAR(100) charset utf8 |
);
|
So we have the same table as partitoned and non partitioned table.
We want to alter column f3(200) from not NULL to NULL,
which is not allowed for algorithm "NOCOPY".
So we get , as expected , an error message.
Non-paritioned table:
MariaDB [d1]> SET SESSION alter_algorithm = 'NOCOPY' ; |
Query OK, 0 rows affected (0,000 sec) |
|
MariaDB [d1]> ALTER online TABLE t1nopar MODIFY COLUMN f3 VARCHAR(201) NULL , LOCK=NONE; |
ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE |
MariaDB [d1]>
|
MariaDB [d1]> show warnings;
|
+-------+------+-----------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+-----------------------------------------------------------------------------+
|
| Error | 1845 | ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE | |
+-------+------+-----------------------------------------------------------------------------+
|
1 row in set (0,000 sec) |
|
For partitioned table the output of "show warnings" looks different:
MariaDB [d1]> SET SESSION alter_algorithm = 'NOCOPY' ; |
Query OK, 0 rows affected (0,000 sec) |
|
|
MariaDB [d1]> ALTER online TABLE t1par MODIFY COLUMN f3 VARCHAR(201) NULL , LOCK=NONE; |
ERROR 1845 (0A000): ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE |
MariaDB [d1]> show warnings;
|
+-------+------+---------------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+---------------------------------------------------------------------------------------+
|
| Error | 1845 | ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE | |
| Error | 6 | Error on delete of './d1/#sql-alter-1-3.par' (Errcode: 2 "No such file or directory") | |
+-------+------+---------------------------------------------------------------------------------------+
|
2 rows in set (0,000 sec) |
|
The message
Error on delete of './d1/#sql-alter-1-3.par' (Errcode: 2 "No such file or directory")
indicates of an issue regarding permissions or path. which is not the case,
so it is misleading and should be changed to a more clear verbose one.