Merge pull request #721 from oblitorum/PT-2277_impossible_on_condition

PT-2277 - fix pt-visual-explain for 'Impossible ON condition' case
This commit is contained in:
Sveta Smirnova
2023-12-04 13:11:44 +03:00
committed by Sveta Smirnova
3 changed files with 55 additions and 2 deletions

View File

@@ -330,7 +330,7 @@ sub transform {
# Dispatch to a class method to generate the tree.
# ##################################################################
my $no_matching_row = join('|',
"Impossible (?:WHERE|HAVING)(?: noticed after reading const tables)?",
"Impossible (?:WHERE|HAVING|ON)(?: noticed after reading const tables| condition)?",
'No matching.*row',
'(?:unique|const) row not found',
);
@@ -499,6 +499,13 @@ sub ref_or_null {
sub const {
my ( $self, $row ) = @_;
if ( !$row->{key} ) {
return {
type => 'Constant table access',
rows => $row->{rows},
children => [$self->table($row)]
}
}
return $self->index_access($row, 'Constant index lookup');
}