mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Seralize empty list as undef.
This commit is contained in:
@@ -161,7 +161,7 @@ sub join_quote {
|
|||||||
sub serialize_list {
|
sub serialize_list {
|
||||||
my ( $self, @args ) = @_;
|
my ( $self, @args ) = @_;
|
||||||
PTDEBUG && _d('Serializing', Dumper(\@args));
|
PTDEBUG && _d('Serializing', Dumper(\@args));
|
||||||
die "Cannot serialize an empty array" unless scalar @args;
|
return unless @args;
|
||||||
|
|
||||||
my @parts;
|
my @parts;
|
||||||
foreach my $arg ( @args ) {
|
foreach my $arg ( @args ) {
|
||||||
|
@@ -126,6 +126,12 @@ is( $q->join_quote('`db`', '`foo`.`tbl`'), '`foo`.`tbl`', 'join_merge(`db`, `foo
|
|||||||
# (de)serialize_list
|
# (de)serialize_list
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
|
|
||||||
|
is(
|
||||||
|
$q->serialize_list( () ),
|
||||||
|
undef,
|
||||||
|
'Serialize empty list returns undef'
|
||||||
|
);
|
||||||
|
|
||||||
binmode(STDOUT, ':utf8')
|
binmode(STDOUT, ':utf8')
|
||||||
or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR";
|
or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR";
|
||||||
binmode(STDERR, ':utf8')
|
binmode(STDERR, ':utf8')
|
||||||
|
Reference in New Issue
Block a user