Merge branch '3.0' into PT-142

This commit is contained in:
Carlos Salguero
2017-05-23 15:19:33 -03:00
25 changed files with 210 additions and 77 deletions

View File

@@ -115,6 +115,25 @@ like(
"..but an unknown charset fails"
);
local $SIG{__WARN__} = undef;
$sb->load_file('master', 't/pt-archiver/samples/table2.sql');
`rm -f archive.test.table_2`;
$output = output(
sub { pt_archiver::main(qw(--where 1=1 --output-format=csv), "--source", "D=test,t=table_2,F=$cnf", "--file", 'archive.%D.%t') },
);
$output = `cat archive.test.table_2`;
is($output, <<EOF
1, 2, 3, "4"
2, "\\N", 3, "4"
3, 2, 3, "\\\t"
4, 2, 3, "\\\n"
5, 2, 3, "Zapp \\"Brannigan"
EOF
, '--output-format=csv');
`rm -f archive.test.table_2`;
# #############################################################################
# Done.
# #############################################################################

View File

@@ -0,0 +1,19 @@
CREATE SCHEMA IF NOT EXISTS test;
use test;
drop table if exists table_2;
create table table_2(
a int not null primary key,
b int,
c int not null,
d varchar(50),
key(b)
) engine=innodb;
insert into table_2 values
(1, 2, 3, 4),
(2, null, 3, 4),
(3, 2, 3, "\t"),
(4, 2, 3, "\n"),
(5, 2, 3, "Zapp \"Brannigan");

View File

@@ -635,7 +635,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',
),
},
@@ -658,7 +658,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",
);