Lowercase index from EXPLAIN (unless it's PRIMARY) to match lowercase ident names from TableParser::parser().

This commit is contained in:
Daniel Nichter
2012-05-08 16:51:35 -06:00
parent 9bb2311fc2
commit 884d02bc2a
3 changed files with 23 additions and 5 deletions

View File

@@ -3993,7 +3993,11 @@ sub get_row_estimate {
PTDEBUG && _d($sql);
my $expl = $cxn->dbh()->selectrow_hashref($sql);
PTDEBUG && _d(Dumper($expl));
return ($expl->{rows} || 0), $expl->{key};
my $mysql_index = $expl->{key} || '';
if ( $mysql_index ne 'PRIMARY' ) {
$mysql_index = lc($mysql_index);
}
return ($expl->{rows} || 0), $mysql_index;
}
sub _prepare_sths {