Bug #90170 mysqldbcopy + generated fields = error 3105
Submitted: 21 Mar 2018 23:34 Modified: 22 Mar 2018 0:34
Reporter: gz — Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:5.7.21 OS:Ubuntu (Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64))
Assigned to: CPU Architecture:Any
Tags: error 3105, generated, mysqldbcopy

[21 Mar 2018 23:34] gz —
Description:
mysqldbcopy can't copy databases with tables where specified generated fields.

How to repeat:
CREATE DATABASE `test`;

CREATE TABLE `test` (
	`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
	`a`  INT UNSIGNED NULL,
	`b`  INT UNSIGNED NULL,
	`c`  INT UNSIGNED GENERATED ALWAYS AS (`a` + `b`) STORED,
	PRIMARY KEY (`id`)
);

INSERT INTO `test`
(`a`, `b`)
VALUES
(1, 1),
(2, 2)
;

> mysqldbcopy --source=root:…@localhost --destination=root:…@localhost test:test_copy

# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Copying database test renamed as test_copy
# Copying TABLE test.test
# Copying data for TABLE test.test
ERROR: Query failed. 3105 (HY000): The value specified for generated column 'c' in table 'test' is not allowed.

Suggested fix:
None.
[22 Mar 2018 0:34] MySQL Verification Team
Thank you for the bug report.

miguel@tikal:~ $  mysqldbcopy --source=root:xxx#@localhost --destination=root:xxx@localhost test:test_copy
WARNING: Using a password on the command line interface can be insecure.
# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Copying database test renamed as test_copy
# Copying TABLE test.test
# Copying data for TABLE test.test
ERROR: Query failed. 3105 (HY000): The value specified for generated column 'c' in table 'test' is not allowed.
miguel@tikal:~ $