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