- OS: Ubuntu 18.4 (On WSL – Windows 11)
- MySQL Version: 5.7.42
- pt-online-schema-change: pt-online-schema-change 3.5.5
- Tool: pt-online-schema-change
- Action:
--alter "ADD ALTER entries__expire (expire)"
Hi,
I’m testing pt-online-schema-change tool and I’m running it locally before going into a beta environment and then production.
I’m not sure if I am doing something wrong but when I try to run the query with --execute
the command does nothing. Nothing is showed in the terminal after I put the password
Other commands works, --dry-run
for example and even adding --print
will run pretty quickly and showing all steps that is performing.
This is the command
pt-online-schema-change --host localhost --user root --ask-pass --alter "ADD ALTER entries__expire (expire)" D=mydatabase,t=entries --execute --print
This works with no errors
pt-online-schema-change --host localhost --user root --ask-pass --alter "ADD INDEX entries__expire (expire)" D=mydatabase,t=entries --dry-run --print
Here the final output (ommitted the first part)
Not copying rows because this is a dry run.
INSERT LOW_PRIORITY IGNORE INTO `mydatabase`.`_entries_new` (`entry_id`, `score`, `data`, `leaderboard_id`, `expire`, `creation`) SELECT `entry_id`, `score`, `data`, `leaderboard_id`, `expire`, `creation` FROM `mydatabase`.`entries` LOCK IN SHARE MODE /*pt-online-schema-change 27903 copy table*/
Not swapping tables because this is a dry run.
Not dropping old table because this is a dry run.
Not dropping triggers because this is a dry run.
DROP TRIGGER IF EXISTS `mydatabase`.`pt_osc_mydatabase_entries_del`
DROP TRIGGER IF EXISTS `mydatabase`.`pt_osc_mydatabase_entries_upd`
DROP TRIGGER IF EXISTS `mydatabase`.`pt_osc_mydatabase_entries_ins`
2024-05-24T12:29:13 Dropping new table...
DROP TABLE IF EXISTS `mydatabase`.`_entries_new`;
2024-05-24T12:29:13 Dropped new table OK.
Dry run complete. `mydatabase`.`entries` was not altered.
What am I doing wrong?