[
https://issues.apache.org/jira/browse/DERBY-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471191
]
Saurabh Vyas commented on DERBY-2287:
-------------------------------------
Thanks Dag & Dan for your inputs. The inconsistency lies in the different
values used in metadata.properties & value returned getDigitPrecision() method.
With the info provided by Dag, is my understanding correct ?
> NUMERIC and DECIMAL have decimal precision.
implies that INT_PRECISION, SMALLINT_PRECISION, LONGINT_PRECISION etc is the
correct value to be used for the precision of exact NUMERIC types.
> This makes me believe the correct precision for REAL, FLOAT and DOUBLE
> should be in terms of binary digits.
then REAL_PRECISION, DOUBLE_PRECISION etc value to be used for precision of
REAL, FLOAT & DOUBLE. Thus rather than calling getDigitPrecision() for
approximate data types, we should call getPrecision() method only & modify this
method to add cases for approximate data types also
Comments / Suggestions ?
But again, any input on how to handle precision for DATE & JAVACLASSNAME ?
> JDBC meta data for precision and size is inconsistent and does not match JDBC
> specifications.
> ---------------------------------------------------------------------------------------------
>
> Key: DERBY-2287
> URL: https://issues.apache.org/jira/browse/DERBY-2287
> Project: Derby
> Issue Type: Bug
> Components: JDBC, Network Client
> Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1,
> 10.2.1.6, 10.2.2.0
> Reporter: Daniel John Debrunner
> Priority: Minor
>
> JDBC 4.0 has clarified the definitions of precision in the java doc for
> various methods that return precision or size. The concept of precision and
> size seems to be the same, just having different method or column names in
> various situations.
> Derby does not follow the JDBC 4 specifications consistently, for example -1
> is sometimes used to indicate not applicable, where JBDC 4 says NULL or 0.
> The precision of datetime columns is defined to be non-zero but in some
> situations Derby returns 0.
> jdbcapi.DatabaseMetaDataTest can show some of these issues, the test of
> getColumns() should compare the information in the COLUMN_SIZE column to the
> ResultSetMetaData getPrecision() method for the same column. The comparisions
> are not made currently because the number of mismatches is high. [this code
> is not yet committed].
> Existing application impact as Derby applications may have been relying on
> the old incorrect & inconsistent behaviour.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.