mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-20 10:55:01 +00:00
Merge branch '3.0' into PT-143
This commit is contained in:
@@ -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.
|
||||
# #############################################################################
|
||||
|
19
t/pt-archiver/samples/table2.sql
Normal file
19
t/pt-archiver/samples/table2.sql
Normal 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");
|
||||
|
Reference in New Issue
Block a user