mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 13:46:22 +00:00
Merge branch '3.0' into PT-142
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");
|
||||
|
@@ -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",
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user