Comment 15 for bug 1705998

Revision history for this message
Imri Zvik (imrizvik) wrote : Re: [Bug 1705998] Re: pt-online-schema-change needs to lowercase columns names when renaming

And the mixed case is perfectly legal and valid. So a perfectly legal and
valid usage can lead to silent data loss. This ranks as a severe bug in my
book.

Btw, technically it is not mixed case but any upper case letters will cause
this. No need to mix case.

On Aug 7, 2017 7:11 PM, "Carlos Salguero" <email address hidden>
wrote:

> Hi,
>
> Yes, but the reason for the possible data loss is that the check_alter
> sub is not able to detect the column rename due to the mixed case in the
> column name
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1705998
>
> Title:
> pt-online-schema-change needs to lowercase columns names when renaming
>
> Status in Percona Toolkit:
> Fix Committed
>
> Bug description:
> I have a table with a column like this:
> `Last_referenced` datetime NOT NULL,
>
> I try to run an alter similar to this:
> CHANGE COLUMN `Last_referenced` `test_column_rename` datetime NOT NULL
>
> But Last_referenced and test_column_rename doesn't appear in the
> common columns list, and therefore not included in the INSERT
> statement of the batch copy, resulting data loss (in this specific
> case, it fails since the column has no default value).
>
> The root cause is that the check in find_renamed_cols
> (https://github.com/percona/percona-toolkit/blob/3.0/bin/pt-online-
> schema-change#L10117) is not normalizing the case of the columns, and
> therefore misses the fact this is a shared column.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/percona-toolkit/+bug/1705998/+subscriptions
>