mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-19 01:09:21 +08:00
PT-126 Fix remove comments regex
This commit is contained in:
@@ -10053,9 +10053,13 @@ sub find_renamed_cols {
|
||||
/x;
|
||||
|
||||
my $table_ident = qr/$unquoted_ident|`$quoted_ident`|"$ansi_quotes_ident"/;
|
||||
my $alter_change_col_re = qr/\bCHANGE \s+ (?:COLUMN \s+)? (?:COMMENT\s+[^\]['].*?[^\]['])?
|
||||
(?:COMMENT\s+[^\]["].*?[^\]["])?
|
||||
($table_ident) \s+ ($table_ident)/ix;
|
||||
|
||||
# remove comments
|
||||
$alter =~ s/^(.*?)\s+COMMENT\s+'(.*?[^\\]')+(.*)/$1$3/;
|
||||
$alter =~ s/^(.*?)\s+COMMENT\s+"(.*?[^\\]")+(.*)/$1$3/;
|
||||
|
||||
my $alter_change_col_re = qr/\bCHANGE \s+ (?:COLUMN \s+)?
|
||||
($table_ident) \s+ ($table_ident)/ix;
|
||||
|
||||
my %renames;
|
||||
while ( $alter =~ /$alter_change_col_re/g ) {
|
||||
|
||||
Reference in New Issue
Block a user