~percona-toolkit-dev/percona-toolkit/turn-off-v-c

« back to all changes in this revision

Viewing changes to lib/ChangeHandler.pm

  • Committer: Brian Fraser
  • Date: 2012-08-24 22:54:05 UTC
  • mfrom: (362.5.1 percona-toolkit)
  • Revision ID: brian.fraser@percona.com-20120824225405-ko98zgqyieyiq01o
Merged fix-930693-changehandler-whitespace-text-cols

Show diffs side-by-side

added added

removed removed

Lines of Context:
488
488
            my $col = $_;
489
489
            if (    $self->{hex_blob}
490
490
                 && $tbl_struct->{type_for}->{$col} =~ m/blob|text|binary/ ) {
491
 
               $col = "IF(`$col`='', '', CONCAT('0x', HEX(`$col`))) AS `$col`";
 
491
               # Here we cast to binary, as otherwise, since text columns are
 
492
               # space padded, MySQL would compare ' ' and '' to be the same.
 
493
               # See https://bugs.launchpad.net/percona-toolkit/+bug/930693
 
494
               $col = "IF(BINARY(`$col`)='', '', CONCAT('0x', HEX(`$col`))) AS `$col`";
492
495
            }
493
496
            else {
494
497
               $col = "`$col`";