[ 
https://issues.apache.org/jira/browse/DERBY-5012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-5012:
--------------------------------------

    Attachment: no-alloc.diff

The patch looks correct to me. The reason why it still works, even if the check 
is backwards, is that the call to updateColumn() in the loop below will 
allocate the array if it is null.

Since both of the arrays will be allocated lazily by updateColumn() anyways, 
I'm thinking that it may make sense to stop allocating them in 
resetUpdatedColumnsForInsert() altogether. See the attached patch 
(no-alloc.diff), which simplifies that method a bit.

> [patch] bad allocation guard
> ----------------------------
>
>                 Key: DERBY-5012
>                 URL: https://issues.apache.org/jira/browse/DERBY-5012
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.7.1.1
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 10.8.0.0
>
>         Attachments: bad_allocation_guard.diff, no-alloc.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> code checks to see if an array is _not_ null, and if so allocates the array. 
> This is backwards. Should check to see if the array is null.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to