[
https://issues.apache.org/jira/browse/DERBY-6177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-6177:
---------------------------------
Attachment: derby-6177-01-ab-copyArrays.diff
Thanks for that suggestion, Knut. It does make the code more concise. In
addition, the previous version of the patch caused the following tests to fail:
org.apache.derbyTesting.functionTests.tests.lang.AlterTableTest
org.apache.derbyTesting.functionTests.tests.lang.VarargsTest
org.apache.derbyTesting.functionTests.tests.lang.UDTTest
org.apache.derbyTesting.functionTests.tests.jdbcapi.ProcedureTest
Attaching a new version of the patch, derby-6177-01-ab-copyArrays.diff. This
patch incorporates Knut's suggestion and fixes the test failures. I am
re-running tests now.
The tests were failing because there were some places in the product code where
we relied on the fact that we could change the state of an object by poking new
values into arrays handed back by its accessors. The fix is to explicitly reset
the arrays in the objects when we need to change the object state.
Touches the following additional files:
-----------------
M java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
Explicitly reset the array of types in a RowSet when we bind the original cells
in the array.
-----------------
M java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
Explicitly reset the parameter types of a routine when we bind the individual
cells in the parameter array.
-----------------
M
java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Explicitly reset the array of base-column-mappings in an index descriptor if we
end up changing one of them while processing a DROP COLUMN action.
> Cleanup suspect coding practices in org.apache.derby.catalog.types
> ------------------------------------------------------------------
>
> Key: DERBY-6177
> URL: https://issues.apache.org/jira/browse/DERBY-6177
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.11.0.0
> Reporter: Rick Hillegas
> Priority: Minor
> Attachments: derby-6177-01-aa-copyArrays.diff,
> derby-6177-01-ab-copyArrays.diff
>
>
> Cleanup suspect coding practices such as accessor methods returning mutable
> objects which can be corrupted by callers.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira