Don't get min/max a 2nd time in _chunk_char(). Use where in _chunk_char(). Test char chunking world_city.name with real range stats. Add failing pt-table-checksum char chunk --where test.

This commit is contained in:
Daniel Nichter
2011-08-27 11:17:28 -06:00
parent 2e0f607589
commit a7ab27bb54
5 changed files with 105 additions and 22 deletions

View File

@@ -24,7 +24,7 @@ if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 13;
plan tests => 14;
}
my ($output, $output2);
@@ -134,7 +134,25 @@ ok(
"t/pt-table-checksum/samples/where01.out",
trf => "awk '{print \$1 \" \" \$2 \" \" \$3}'",
),
"--where affects range stats (bug 821673)"
"--where affects int range stats (bug 821673)"
);
# Test it again with a varchar primary key. The resulting 5 rows are:
# | Apple | 2011-03-03 |
# | lemon | 2011-03-03 |
# | lime | 2011-03-03 |
# | pineapple | 2011-03-03 |
# | raspberry | 2011-03-03 |
$sb->load_file('master', "t/pt-table-checksum/samples/where02.sql");
ok(
no_diff(
sub { pt_table_checksum::main(@args,
qw(--no-zero-chunk --chunk-size 5), '--where', "date = '2011-03-03'");
},
"t/pt-table-checksum/samples/where02.out",
trf => "awk '{print \$1 \" \" \$2 \" \" \$3}'",
),
"--where affects char range stats (bug 821673)"
);
# #############################################################################