File tree 1 file changed +12
-15
lines changed
1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -331,25 +331,22 @@ sub AddDefaultValues
331
331
foreach my $column (@$schema )
332
332
{
333
333
my $attname = $column -> {name };
334
- my $atttype = $column -> {type };
335
334
336
- if (defined $row -> {$attname })
337
- {
338
- ;
339
- }
340
- elsif ($attname eq ' oid' )
341
- {
342
- ;
343
- }
344
- elsif (defined $column -> {default })
335
+ # No work if field already has a value.
336
+ next if defined $row -> {$attname };
337
+
338
+ # Ignore 'oid' columns, they're handled elsewhere.
339
+ next if $attname eq ' oid' ;
340
+
341
+ # If column has a default value, fill that in.
342
+ if (defined $column -> {default })
345
343
{
346
344
$row -> {$attname } = $column -> {default };
345
+ next ;
347
346
}
348
- else
349
- {
350
- # Failed to find a value.
351
- push @missing_fields , $attname ;
352
- }
347
+
348
+ # Failed to find a value for this field.
349
+ push @missing_fields , $attname ;
353
350
}
354
351
355
352
# Failure to provide all columns is a hard error.
You can’t perform that action at this time.
0 commit comments