From f5413f4472aaecdfa723622e6e30b40b4d8c8eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ChinaXing=EF=BC=88=E9=99=88=E4=BA=91=E6=98=9F=EF=BC=89?= Date: Thu, 27 Jun 2013 00:18:47 +0800 Subject: [PATCH] -- adjust code for support subwith when subwith query result columns are whole null -- --- lib/Async/ORM.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Async/ORM.pm b/lib/Async/ORM.pm index 54c3f11..8976843 100644 --- a/lib/Async/ORM.pm +++ b/lib/Async/ORM.pm @@ -1194,8 +1194,11 @@ sub _map_row_to_object { if ($rel_info->{subwith}) { foreach my $subwith (@{$rel_info->{subwith}}) { $parent_object = $parent_object->_related->{$subwith}; - die "load $subwith first" unless $parent_object; + # do not check , for compatible when whole 'null' columns of a subwith + # die "load $subwith first" unless $parent_object; + last unless $parent_object; } + splice @$row, 0, scalar @{$rel_info->{columns}} and next unless $parent_object; } foreach my $parent_object_ (