Implement IndexLength in pt-table-checksum and pt-online-schema-change. Tag the IndexLength queries with "key_len" and make n_index_cols optional--get full key_len if not given.

This commit is contained in:
Daniel Nichter
2012-06-11 12:54:26 -04:00
parent 4f3bdabf7c
commit 3f2295ec46
5 changed files with 377 additions and 42 deletions

View File

@@ -175,7 +175,7 @@ is(
$exit_status,
0,
"Bad key_len chunks are not errors"
);
) or diag($output);
cmp_ok(
PerconaTest::count_checksum_results($output, 'skipped'),
@@ -223,14 +223,18 @@ $output = output(
$exit_status = pt_table_checksum::main(
$master_dsn, '--max-load', '',
qw(--lock-wait-timeout 3 --chunk-size 1000 -t sakila.film_actor),
qw(--chunk-index-columns 1),
qw(--chunk-index-columns 1 --chunk-size-limit 3),
);
},
stderr => 1,
);
is(
# Since we're not using the full index, it's basically a non-unique index,
# so there are dupes. The table really has 5462 rows, so we must get
# at least that many, and probably a few more.
cmp_ok(
PerconaTest::count_checksum_results($output, 'rows'),
'>=',
5462,
"Initial key_len reflects --chunk-index-columns"
) or diag($output);