Merge pull request #219 from percona/PT-126-a

PT-126 Recognize comments having quotes
This commit is contained in:
Carlos Salguero
2017-05-16 13:54:27 -03:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -10053,7 +10053,8 @@ 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+[^\]['"].*?[^\]['"])?
my $alter_change_col_re = qr/\bCHANGE \s+ (?:COLUMN \s+)? (?:COMMENT\s+[^\]['].*?[^\]['])?
(?:COMMENT\s+[^\]["].*?[^\]["])?
($table_ident) \s+ ($table_ident)/ix;
my %renames;

View File

@@ -610,7 +610,7 @@ $sb->load_file('master', "$sample/bug-1613915.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=o1",
'--execute',
'--alter', "ADD COLUMN c INT COMMENT 'change plus more than one word'",
'--alter', "ADD COLUMN c INT COMMENT 'change \"plus\" more than one word'",
'--chunk-size', '10', '--no-check-alter',
),
},
@@ -633,7 +633,7 @@ is(
$rows = $master_dbh->selectrow_arrayref("SHOW CREATE TABLE test.o1");
like(
$rows->[1],
qr/COMMENT 'change plus more than one word'/,
qr/COMMENT 'change "plus" more than one word'/,
"recognize comments",
);