PT-2346 - t/pt-table-sync/specify_column_or_index.t fails with 5.7

- Adjusted regular expression, so it is independent from randomness of the query plan calculation by EXPLAIN: we test if specified index or column used, not the range of values.
This commit is contained in:
Sveta Smirnova
2025-09-09 16:10:45 +03:00
parent 4388b4f54f
commit fef02540fe

View File

@@ -44,16 +44,16 @@ $output = `$trunk/bin/pt-table-sync --sync-to-source h=127.1,P=12346,u=msandbox,
# and EXPLAIN does not guarantee accuracy of results. # and EXPLAIN does not guarantee accuracy of results.
like( like(
$output, $output,
qr/FROM `issue_375`.`t` FORCE INDEX \(`updated_at`\) WHERE \(`updated_at` > 0 AND `updated_at` < '2009-09-05 02:\d\d:\d\d'/, qr/FROM `issue_375`.`t` FORCE INDEX \(`updated_at`\) WHERE \(`updated_at` > 0 AND `updated_at` < '2009-09-05 \d\d:\d\d:\d\d'/,
'--chunk-index', '--chunk-index',
); ) or diag($output);
$output = `$trunk/bin/pt-table-sync --sync-to-source h=127.1,P=12346,u=msandbox,p=msandbox -d issue_375 --print -v -v --chunk-size 50 --chunk-column updated_at`; $output = `$trunk/bin/pt-table-sync --sync-to-source h=127.1,P=12346,u=msandbox,p=msandbox -d issue_375 --print -v -v --chunk-size 50 --chunk-column updated_at`;
like( like(
$output, $output,
qr/FROM `issue_375`.`t` FORCE INDEX \(`updated_at`\) WHERE \(`updated_at` > 0 AND `updated_at` < '2009-09-05 02:\d\d:\d\d'/, qr/FROM `issue_375`.`t` FORCE INDEX \(`updated_at`\) WHERE \(`updated_at` > 0 AND `updated_at` < '2009-09-05 \d\d:\d\d:\d\d'/,
'--chunk-column', '--chunk-column',
); ) or diag($output);
# ############################################################################# # #############################################################################
# Done. # Done.