Pt-online-schema-change’s triggers fail with “DELETE command denied” on insert

percona-tools

We recently tried pt-online-schema-change to add a column to a table. It worked mostly as expected but one thing puzzles me: in case the account we use to do the migration doesn't have the DELETE permission, our application (which keeps running simultaneously) gets errors that say "DELETE command denied to user 'pt'@'localhost' for table '_xxx_new'" when the app is performing an insert on the xxx table.

My understanding is that the triggers are to do inserts to the destitation _xxx_new table when a new record is inserted in the source xxx table. How come it may fail with not having a DELETE permission??

Percona docs are pretty generic on this and no googling helped, so will be thankful for any ideas!

Best Answer

The issue turned out to be that the triggers that the pt-online-schema-change tool creates for insert and update use the REPLACE DDL command of MySQL, which requires the DELETE permission to execute.

Related Question