When I’m doing conventional ALTER TABLE in MySQL I can ignore default value and it will be assigned based on the column type. For example this alter table sbtest add column v varchar(100) not null would work even though we do not specify default value. MySQL will assign empty string as default default value for varchar column. This however does not work for pt-online-schema-change:
root@smt2:~# pt-online-schema-change --execute --alter="add column v varchar(100) not null" D=sbtest,t=sbtest Altering `sbtest`.`sbtest`... Creating new table... Created new table sbtest._sbtest_new OK. Altering new table... Altered `sbtest`.`_sbtest_new` OK. Creating triggers... Created triggers OK. Copying approximately 10000060 rows... Dropping triggers... Dropped triggers OK. Dropping new table... Dropped new table OK. `sbtest`.`sbtest` was not altered. (in cleanup) Error copying rows from `sbtest`.`sbtest` to `sbtest`.`_sbtest_new`: Copying …[Read more]