Open babinomec opened 5 years ago
Do you have any current rows where c186 is null? If so you'll have to address that first. I imagine this is the MySQL strictness setting raising the error.
Do you have any current rows where c186 is null? If so you'll have to address that first.
Two things :
I'll try to remove the original NULL values, but I suspect I'll get the error again when inserting a new line.
I imagine this is the MySQL strictness setting raising the error.
I used --skip-strict-mode
but I'm not sure it changes much in this case.
I'll try to remove the original NULL values, but I suspect I'll get the error again when inserting a new line.
You'll need to address both. First, make sure your new queries do not contain NULL
s, or rather, make sure they have some default value. Then, backfill your existing NULL
values.
For gh-ost
to implicitly solve this - it would be possible, but with some considerable effort and probably also risk (gh-ost
will be modifying data on your behalf, I can see how this can go wrong).
When trying to change a column from NULLABLE to NOT NULL, I run in the following error :
Error 1048: Column 'c186' cannot be null
Version :
Call :
Relevant table structure :
Error from log :
From what I understand it's probably from queries in the binlog being applied, when those don't contain every column, they are written in RBR with their default value, hence trying to insert a NULL value (old default) to a NOT NULL column (new structure).
Is there a way to address that ?