Description:
The is_explicit_collation is false, even the collate of the column does match the collate of the table.
The COLLATE of column a is utf8mb4_bin, and the COLLATE of the table is utf8mb4_unicode_ci.
mysql> show create table ta\G
*************************** 1. row ***************************
Table: ta
Create Table: CREATE TABLE `ta` (
`a` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
1 row in set (0.01 sec)
However, the is_explicit_collation is false in ibd.
shell> ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}'
{
"is_explicit_collation": false
}
After recreating the table, the is_explicit_collation becomes true.
ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}'
{
"is_explicit_collation": true
}
How to repeat:
- create the table in mysql
create database test;
use test
create table ta (
`a` char(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
- check the is_explicit_collation with idb2sdi
ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}'
- recreate the table with mysqldump
mysqldump test ta | mysql test
- check the is_explicit_collation again with idb2sdi
ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}'
Description: The is_explicit_collation is false, even the collate of the column does match the collate of the table. The COLLATE of column a is utf8mb4_bin, and the COLLATE of the table is utf8mb4_unicode_ci. mysql> show create table ta\G *************************** 1. row *************************** Table: ta Create Table: CREATE TABLE `ta` ( `a` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.01 sec) However, the is_explicit_collation is false in ibd. shell> ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}' { "is_explicit_collation": false } After recreating the table, the is_explicit_collation becomes true. ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}' { "is_explicit_collation": true } How to repeat: - create the table in mysql create database test; use test create table ta ( `a` char(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; - check the is_explicit_collation with idb2sdi ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}' - recreate the table with mysqldump mysqldump test ta | mysql test - check the is_explicit_collation again with idb2sdi ibd2sdi /var/lib/mysql/test/ta.ibd | jq '.[1].object.dd_object.columns[0] | {is_explicit_collation: .is_explicit_collation}'