X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSource%2FRowParser%2FUtil.pm;h=3cf4aee92df1d036c2ffc185bc1057643c2c4848;hb=2fdeef656102aed6c01b6af14d0f14ef06673fb3;hp=4a03a554df3024ba7df713c2a5657abdd25ec790;hpb=b09652f78cc177d2fe8fdc17c9c3cddb432c7e6b;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSource/RowParser/Util.pm b/lib/DBIx/Class/ResultSource/RowParser/Util.pm index 4a03a55..3cf4aee 100644 --- a/lib/DBIx/Class/ResultSource/RowParser/Util.pm +++ b/lib/DBIx/Class/ResultSource/RowParser/Util.pm @@ -153,12 +153,15 @@ sub assemble_collapsing_parser { my @idcol_args = $no_rowid_container ? ('', '') : ( ', %cur_row_ids', # only declare the variable if we'll use it - join ("\n", map { qq(\$cur_row_ids{$_} = ) . ( - # in case we prune - we will never hit these undefs - $args->{prune_null_branches} ? qq(\$cur_row_data->[$_];) - : HAS_DOR ? qq(\$cur_row_data->[$_] // "\0NULL\xFF\$rows_pos\xFF$_\0";) - : qq(defined(\$cur_row_data->[$_]) ? \$cur_row_data->[$_] : "\0NULL\xFF\$rows_pos\xFF$_\0";) - ) } sort { $a <=> $b } keys %{ $stats->{idcols_seen} } ), + join ("\n", map { + my $quoted_null_val = qq( "\0NULL\xFF\${rows_pos}\xFF${_}\0" ); + qq(\$cur_row_ids{$_} = ) . ( + # in case we prune - we will never hit these undefs + $args->{prune_null_branches} ? qq( \$cur_row_data->[$_]; ) + : HAS_DOR ? qq( \$cur_row_data->[$_] // $quoted_null_val; ) + : qq( defined(\$cur_row_data->[$_]) ? \$cur_row_data->[$_] : $quoted_null_val; ) + ) + } sort { $a <=> $b } keys %{ $stats->{idcols_seen} } ), ); my $parser_src = sprintf (<<'EOS', @idcol_args, $top_node_key_assembler||'', $top_node_key, join( "\n", @{$data_assemblers||[]} ) );