Comment 10 for bug 1010232

Revision history for this message
Marcos Albe (marcos-albe) wrote :

Seems code related to this bug fix has it's own bug?

./pt-online-schema-change --execute
--alter-foreign-keys-method=rebuild_constraints --password=root
--user=root --lock-wait-time=50 --alter="ADD COLUMN
lacolumna TINYINT NOT NULL DEFAULT 1"
D=thedb,t=thetable

I get this:
Error copying rows from `thedb`.`thetable` to
`thedb`.`_thetable_new`: Use of uninitialized value in numeric lt
(<) at ./pt-online-schema-change line 6519.

And code in 6519 is the following:

   # Ensure that MySQL is still using the entire index.
   # https://bugs.launchpad.net/percona-toolkit/+bug/1010232
   if ( !$nibble_iter->one_nibble()
        && $tbl->{key_len}
        && ($expl->{key_len} || 0) < $tbl->{key_len} ) {
      if ( !$tbl->{warned}->{key_len}++
           && $o->get('quiet') < 2 ) {
         die "Error copying rows at chunk " . $nibble_iter->nibble_number()
            . " of $tbl->{db}.$tbl->{tbl} because MySQL used "
            . "only " . ($expl->{key_len} || 0) . " bytes "
            . "of the " . ($expl->{key} || '?') . " index instead of "
            . $tbl->{key_len} . ". See the --[no]check-plan documentation "
            . "for more information.\n";
      }
   }

Brian confirmed 'quiet' has no default set.