Merge branch '3.0' into PT-143

This commit is contained in:
Carlos Salguero
2017-05-23 16:59:30 -03:00
11 changed files with 226 additions and 56 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");