Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.1(EOL), 10.2(EOL)
-
None
Description
Found on stackoverflow.
MariaDB [test]> create table t1 (i int) charset latin1; |
Query OK, 0 rows affected (0.43 sec) |
|
MariaDB [test]> alter table t1 convert to character set utf8; |
Query OK, 0 rows affected (0.00 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> show create table t1 \G |
*************************** 1. row ***************************
|
Table: t1 |
Create Table: CREATE TABLE `t1` ( |
`i` int(11) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
1 row in set (0.00 sec) |
This works:
MariaDB [test]> alter table t1 convert to character set utf8, force; |
Query OK, 0 rows affected (1.16 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> show create table t1 \G |
*************************** 1. row ***************************
|
Table: t1 |
Create Table: CREATE TABLE `t1` ( |
`i` int(11) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
1 row in set (0.00 sec) |
This also works:
MariaDB [test]> alter table t1 convert to character set utf8, algorithm=copy; |
Query OK, 0 rows affected (1.16 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> show create table t1 \G |
*************************** 1. row ***************************
|
Table: t1 |
Create Table: CREATE TABLE `t1` ( |
`i` int(11) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
1 row in set (0.00 sec) |
And this:
MariaDB [test]> create table t1 (c char) charset latin1; |
Query OK, 0 rows affected (0.33 sec) |
|
MariaDB [test]> alter table t1 convert to character set utf8; |
Query OK, 0 rows affected (1.18 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> show create table t1 \G |
*************************** 1. row ***************************
|
Table: t1 |
Create Table: CREATE TABLE `t1` ( |
`c` char(1) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
1 row in set (0.00 sec) |
Not reproducible on MySQL 5.6-5.7.