← Back to team overview

maria-developers team mailing list archive

Re: Row-based replication of old DECIMAL to new DECIMAL

 

Hi,

On 22.12.2014 13:26, Sergei Golubchik wrote:
Hi, Alexander!

On Dec 22, Alexander Barkov wrote:
Hi Sergei, Kristian,

I'm looking at:

MDEV-7268 Column of table cannot be converted from type 'decimal(0,?)'
to type ' 'decimal(10,7)'

This bug cannot be fixed in general case, because the old DECIMAL data
type does not write its metadata into the binary log.

I suggest we don't fix replication of old DECIMAL
(neither binlogging, nor slave-side).

I think that's reasonable. But then CHECK TABLE ... FOR UPGRADE
should issue a warning for old DECIMAL columns.

Instead, we fix "ALTER TABLE ... FORCE" (and thus mysql_upgrade)
to force changing old DECIMAL to new DECIMAL.
Currently, "ALTER TABLE...FORCE" preserve old DECIMAL.

Not sure which version is best to fix in.
The complainer had problems with 5.5.

I don't know, I'd say 10.0.

For the complainer there's a workaround - I'm sure you can come up with
an ALTER TABLE that changes columns from old to new DECIMAL, may be
something like ALTER TABLE xxx MODIFY COLUMN yyy DECIMAL(....)


For the reporter, there is already a workaround -- he can manually perform the operation which pt-online-schema-change failed to finish -- create a new table with the same DDL, populate it, and then switch the tables.

/E


Regards,
Sergei



References