pt-online-schema-change errors out on a binary primary key utf8 starting with 5.5.46.5 and later versions (even 5.6)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Invalid
|
Undecided
|
Unassigned |
Bug Description
A regular alter on the table works fine and I even tried copying and pasting the queries generated by pt-online-
$ pt-online-
pt-online-
show global variables like 'char%';
+------
| Variable_name | Value |
+------
| character_
| character_
| character_
| character_
| character_
| character_
| character_
| character_sets_dir | /home/dcassar/
+------
Table:
CREATE TABLE `TABLE_NAME` (
`id` binary(16) NOT NULL,
`refCount` int(11) NOT NULL DEFAULT '0',
`createdDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdBy` char(20) DEFAULT NULL,
`comment` varchar(1024) DEFAULT NULL,
`title` varchar(128) DEFAULT NULL,
`tbSupported` tinyint(1) NOT NULL DEFAULT '1',
`creationStatus` enum('OPEN'
`cd` tinyint(1) NOT NULL DEFAULT '0',
`ad` tinyint(1) NOT NULL DEFAULT '0',
`url` varchar(1024) DEFAULT NULL,
`supportedHt` int(11) DEFAULT '0',
`verification
`usmmi` char(20) DEFAULT NULL,
`nextColumnIndex` int(11) NOT NULL DEFAULT '1',
`nextuserColu
`static` varchar(1024) DEFAULT NULL,
`statictwo` varchar(1024) DEFAULT NULL,
`website` char(255) DEFAULT NULL,
`ai` binary(16) NOT NULL,
`verid` binary(16) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_id_ai` (`ai`),
KEY `idx_refCount_
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
pt-online-
--user user \
--password password \
--host localhost \
--port 3306 \
--nocheck-
--chunk-time=0.5 \
--chunk-
--recursion-
--max-load=
--critical-
--set-vars=
--tries=
--alter-
--alter 'ADD COLUMN test3 VARCHAR(255) NOT NULL DEFAULT ""' \
--charset=utf8 \
--no-drop-old-table \
--no-swap-tables \
--execute
No slaves found. See --recursion-method if host <hostname> has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
*******
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
together with SSL_ca_
If you really don't want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******
at /usr/bin/
*******
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
together with SSL_ca_
If you really don't want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******
at /usr/bin/
Operation, tries, wait:
analyze_table, 10, 1
copy_rows, 100, 1
create_triggers, 15, 5
drop_triggers, 100, 5
swap_tables, 100, 5
update_
No foreign keys reference `DATABASE_
Altering `DATABASE_
Creating new table...
Created new table DATABASE_
Altering new table...
Altered `DATABASE_
2016-10-14T22:03:11 Creating triggers...
2016-10-14T22:03:11 Created triggers OK.
2016-10-14T22:03:11 Copying approximately 102632 rows...
2016-10-14T22:03:11 Dropping triggers...
2016-10-14T22:03:11 Dropped triggers OK.
2016-10-14T22:03:11 Dropping new table...
2016-10-14T22:03:11 Dropped new table OK.
`DATABASE_
2016-10-14T22:03:11 Error copying rows from `DATABASE_
Level: Warning
Code: 1300
Message: Invalid utf8 character string: '8D5381'
Query: INSERT LOW_PRIORITY IGNORE INTO `DATABASE_
identified as related to https:/ /bugs.mysql. com/bug. php?id= 79317 and a solution is to set --charset=binary. If you think you would rather make pt-osc automatically switch to that charset for a binary pkey that'd be great but if not and you think the user should set charset to binary then feel free to close.