mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-02-27 02:00:57 +08:00
Merge pull request #516 from ikruglov/PT-1860-pt-osc-case-insensitive
PT-1860 make pt-osc respect case insesitive lookup on Windows and osx
This commit is contained in:
@@ -3470,11 +3470,29 @@ sub check_table {
|
||||
}
|
||||
my ($dbh, $db, $tbl) = @args{@required_args};
|
||||
my $q = $self->{Quoter} || 'Quoter';
|
||||
$self->{check_table_error} = undef;
|
||||
|
||||
|
||||
my $lctn_sql = 'SELECT @@lower_case_table_names';
|
||||
PTDEBUG && _d($lctn_sql);
|
||||
|
||||
my $lower_case_table_names;
|
||||
eval { ($lower_case_table_names) = $dbh->selectrow_array($lctn_sql); };
|
||||
if ( $EVAL_ERROR ) {
|
||||
PTDEBUG && _d($EVAL_ERROR);
|
||||
$self->{check_table_error} = $EVAL_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PTDEBUG && _d("lower_case_table_names=$lower_case_table_names");
|
||||
if ($lower_case_table_names > 0) {
|
||||
PTDEBUG && _d("MySQL uses case-insensitive lookup, converting '$tbl' to lowercase");
|
||||
$tbl = lc $tbl;
|
||||
}
|
||||
|
||||
my $db_tbl = $q->quote($db, $tbl);
|
||||
PTDEBUG && _d('Checking', $db_tbl);
|
||||
|
||||
$self->{check_table_error} = undef;
|
||||
|
||||
my $sql = "SHOW TABLES FROM " . $q->quote($db)
|
||||
. ' LIKE ' . $q->literal_like($tbl);
|
||||
PTDEBUG && _d($sql);
|
||||
|
||||
Reference in New Issue
Block a user