PT-2401 - pt-online-schema-change 'table does not exist' on macos

- Modified code, so it still checks table name but based on the lower_case_table_names option
This commit is contained in:
Sveta Smirnova
2025-08-15 17:16:37 +03:00
parent 5989d2883c
commit 75feef2f96
12 changed files with 36 additions and 84 deletions

View File

@@ -2114,12 +2114,6 @@ sub check_table {
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);
@@ -2135,7 +2129,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -504,12 +504,6 @@ sub check_table {
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);
@@ -525,7 +519,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -2061,12 +2061,6 @@ sub check_table {
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);
@@ -2082,7 +2076,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -3935,12 +3935,6 @@ sub check_table {
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);
@@ -3956,7 +3950,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -3313,12 +3313,6 @@ sub check_table {
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);
@@ -3334,7 +3328,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -3184,12 +3184,6 @@ sub check_table {
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);
@@ -3205,7 +3199,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -3503,12 +3503,6 @@ sub check_table {
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);
@@ -3524,7 +3518,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -9064,12 +9064,6 @@ sub check_table {
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);
@@ -9085,7 +9079,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -4697,12 +4697,6 @@ sub check_table {
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);
@@ -4718,7 +4712,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -3041,12 +3041,6 @@ sub check_table {
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);
@@ -3062,7 +3056,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -7051,12 +7051,6 @@ sub check_table {
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);
@@ -7072,7 +7066,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}

View File

@@ -341,12 +341,6 @@ sub check_table {
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);
@@ -362,7 +356,9 @@ sub check_table {
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] ) {
if ( !$row->[0]
|| ( $lower_case_table_names == 0 && $row->[0] ne $tbl )
|| ( $lower_case_table_names > 0 && lc $row->[0] ne lc $tbl ) ) {
PTDEBUG && _d('Table does not exist');
return 0;
}