From: Norbert Buchmuller Date: Sun, 16 Nov 2008 21:20:44 +0000 (+0000) Subject: Made stringify_bind() work with 'bindtype' set to 'columns' and 'array_datatypes... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c7049adaccaceb0954df7a591d9b00eaa0043e1;p=scpubgit%2FQ-Branch.git Made stringify_bind() work with 'bindtype' set to 'columns' and 'array_datatypes' set to true. --- diff --git a/lib/SQL/Abstract/Test.pm b/lib/SQL/Abstract/Test.pm index d55f3a8..31a0eb7 100644 --- a/lib/SQL/Abstract/Test.pm +++ b/lib/SQL/Abstract/Test.pm @@ -52,8 +52,17 @@ sub stringify_bind { # some bind values can be arrayrefs (see L), # so stringify them. - my @strings = map {ref $_ eq 'ARRAY' ? join('=>', @$_) : ($_ || '')} - @$bind_ref; + # furthermore, if L is set to true, elements + # of those arrayrefs can be arrayrefs, too. + my @strings = map { + ref $_ eq 'ARRAY' + ? join('=>', map { + ref $_ eq 'ARRAY' + ? ('[' . join('=>', @$_) . ']') + : (defined $_ ? $_ : '') + } @$_) + : (defined $_ ? $_ : '') + } @$bind_ref; # join all values into a single string return join "///", @strings;