Description:
When I try to migrate a blob value, the migration toolkit tries to set a default value for the blob column.
Source Table:
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| country | char(2) | NO | PRI | | |
| internal_name | varchar(255) | NO | | | |
| flag | mediumblob | NO | | | |
+---------------+--------------+------+-----+---------+-------+
Migration Toolkit SQL:
DROP TABLE IF EXISTS `mytest`.`countries`;
CREATE TABLE `mytest`.`countries` (
`country` CHAR(2) NOT NULL DEFAULT '',
`internal_name` VARCHAR(255) NOT NULL DEFAULT '',
`flag` MEDIUMBLOB NOT NULL DEFAULT '',
PRIMARY KEY (`country`)
)
ENGINE = INNODB;
The SQL above fails on the target MySQL server.
How to repeat:
Create the table on MySQL Server A:
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| country | char(2) | NO | PRI | | |
| internal_name | varchar(255) | NO | | | |
| flag | mediumblob | NO | | | |
+---------------+--------------+------+-----+---------+-------+
Migrate the table above to MySQL Server B.
Suggested fix:
The Migration Toolkit should generate the following SQL:
DROP TABLE IF EXISTS `mytest`.`countries`;
CREATE TABLE `mytest`.`countries` (
`country` CHAR(2) NOT NULL DEFAULT '',
`internal_name` VARCHAR(255) NOT NULL DEFAULT '',
`flag` MEDIUMBLOB NOT NULL,
PRIMARY KEY (`country`)
)
ENGINE = INNODB;
Instead of:
DROP TABLE IF EXISTS `mytest`.`countries`;
CREATE TABLE `mytest`.`countries` (
`country` CHAR(2) NOT NULL DEFAULT '',
`internal_name` VARCHAR(255) NOT NULL DEFAULT '',
`flag` MEDIUMBLOB NOT NULL DEFAULT '',
PRIMARY KEY (`country`)
)
ENGINE = INNODB;