PT-2277 - fix pt-visual-explain for 'Impossible ON condition' case

This commit is contained in:
Jason
2023-11-07 01:16:55 +08:00
parent 0d10bc96b8
commit b2b6311723
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');
}