pt-online-schema-change won't work with backtick in default column value

Bug #1719866 reported by Bogdan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

Hello. Thanks for a great toolkit!

Experiencing following problem:

Trying to add an index online to MySQL Aurora table `users`.

Flags for command are `--alter-foreign-keys-method=rebuild_constraints --execute`.

I've simplified the copy of the target table for bugreport:

CREATE TABLE `test_users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tag` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL,
  `salt` varchar(50) NOT NULL DEFAULT '123`456',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT

I'm adding an index for a field (tag), but getting this error:

The new table `foobar`.`_test_users_new` does not have a PRIMARY KEY or a unique index which is required for the DELETE trigger.

Obviously it does have a primary key on the table. What causing the problem is the backtick (grave accent) in the default value of `salt` (unrelated) column. Surprisingly, when removing it from the default value, error disappears.
Looks like table definition isn't parsed properly due to the backtick or something like that :)..

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1447

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.