EXPLAIN actual ascending nibble query to get MySQL's chosen index, and use that instead of the tool's chosen index. TODO: fix OobNibbleIterator.t and chunk_index.t.

This commit is contained in:
Daniel Nichter
2012-05-04 17:46:34 -06:00
parent 69b7a6b6a5
commit e2073065b1
5 changed files with 196 additions and 44 deletions

View File

@@ -25,7 +25,7 @@ if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 10;
plan tests => 11;
}
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
@@ -141,6 +141,22 @@ is(
"14 rows checksummed (bug 925855)"
);
# #############################################################################
# Bug 978432: PK is ignored
# #############################################################################
$sb->load_file('master', "t/pt-table-checksum/samples/not-using-pk-bug.sql");
PerconaTest::wait_for_table($dbh, "test.multi_resource_apt", "apt_id=4 AND res_id=4");
ok(
no_diff(
sub { pt_table_checksum::main(@args,
qw(-t test.multi_resource_apt --chunk-size 2 --explain --explain))
},
"t/pt-table-checksum/samples/not-using-pk-bug.out",
),
"Smarter chunk index selection (bug 978432)"
);
# #############################################################################
# Done.
# #############################################################################