[ 
https://issues.apache.org/jira/browse/DERBY-3398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579042#comment-13579042
 ] 

Knut Anders Hatlen commented on DERBY-3398:
-------------------------------------------

Looks fine to me. It won't be fully consistent with the client driver until 
DERBY-5534 is fixed, but now at least it should be possible to fix DERBY-5534 
without adding knowledge about the DB2 limits to the client driver.

Some small comments:

- The changes to DataDictionaryImpl look like leftovers from an earlier patch.

- Changes10_10 imports sun.print.PSStreamPrintService. It shouldn't.

- Changes10_10 uses SQLDataException. Will that work on older platforms (before 
JDBC 4.0)?

- It might be worth adding test cases for +/- Float.MIN_NORMAL and +/- 
Double.MIN_NORMAL. Cannot use the constants directly, as they were added in 
Java 6, but the values could be tested. Those would test that we're no longer 
limited by DB2_SMALLEST_POSITIVE_REAL, DB2_LARGEST_NEGATIVE_REAL, 
DB2_SMALLEST_POSITIVE_DOUBLE and DB2_LARGEST_NEGATIVE_DOUBLE.

- Nit: The two normalizeREAL() methods use different casing of "invalid". I 
prefer the lowercase variant.

- Typo: Comment in NumberDataType.useDB2Limits() says "do no" instead of "do 
not".

- Changes10_10: The ResultSets produced in the first for loop aren't closed.

- Changes10_10: There are three PreparedStatements stored in fields. This 
technique has been a frequent source of memory leaks in the tests, so it is 
best avoided if possible. In this case, I think it will prevent the class 
loaders for the old engines to be garbage collected after the test has 
completed. Setting the fields to null in tearDown() would help, but making them 
local variables is probably less error-prone.
                
> Support min/max values for Java types float/double in real/double columns
> -------------------------------------------------------------------------
>
>                 Key: DERBY-3398
>                 URL: https://issues.apache.org/jira/browse/DERBY-3398
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.4.1.3
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>            Priority: Minor
>              Labels: derby_triage10_10
>         Attachments: derby-3398-2.diff, derby-3398-3.diff, derby-3398-3.stat, 
> derby-3398-4.diff, derby-3398-5.diff, derby-3398-5.stat, derby-3398.diff, 
> derby-3398.status
>
>
> Derby doesn't support the entire range of valid (finite) values of the Java 
> primitive types double/float in columns with SQL type DOUBLE or REAL. This 
> appears to be a limitation that was introduced for compatibility with DB2. 
> There have been some requests on derby-user that we lift this restriction.
> The restriction is enforced by the methods normalizeREAL() and 
> normalizeDOUBLE() in org.apache.derby.iapi.types.NumberDataType.

--
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

Reply via email to