Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 992E3200B55 for ; Sun, 31 Jul 2016 19:10:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 97D70160A61; Sun, 31 Jul 2016 17:10:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E7DFC160AA9 for ; Sun, 31 Jul 2016 19:10:21 +0200 (CEST) Received: (qmail 35748 invoked by uid 500); 31 Jul 2016 17:10:21 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 35637 invoked by uid 99); 31 Jul 2016 17:10:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2016 17:10:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CE1F12C0D63 for ; Sun, 31 Jul 2016 17:10:20 +0000 (UTC) Date: Sun, 31 Jul 2016 17:10:20 +0000 (UTC) From: "Danoja Dias (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Issue Comment Deleted] (DERBY-853) ResultSetMetaData.getScale returns inconsistent values for DOUBLE type. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 31 Jul 2016 17:10:22 -0000 [ https://issues.apache.org/jira/browse/DERBY-853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Danoja Dias updated DERBY-853: ------------------------------ Comment: was deleted (was: {quote}did it fix the Derby853.java test?{quote} Yes. It fixed Derby853.java test. {quote}I wonder if there is a way to fix this somewhere near line 258 instead, because it seems like at line 258 we shouldn't even be calling the getScale() method if higherType is not a DECIMAL type, so maybe that call get getScale() should be inside the "if" test at line 260?{quote} Yes. We shouldn't call getScale() is it is not decimal. I'll check it and attach a new patch.) > ResultSetMetaData.getScale returns inconsistent values for DOUBLE type. > ----------------------------------------------------------------------- > > Key: DERBY-853 > URL: https://issues.apache.org/jira/browse/DERBY-853 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.2.1.6 > Reporter: Daniel John Debrunner > Assignee: Danoja Dias > Priority: Trivial > Labels: derby_triage10_5_2 > Attachments: Derby-853.diff, Derby853.java > > > If a DOUBLE column is returned in the result set then getScale() returns 0. > If a DOUBLE expression is returned and the expression is the result of a DOUBLE combined with a DECIMAL then it seems the scale from the decimal sometimes affects the result set metadata. > E.g. DECIMAL(10,2) - DOUBLE returns a DOUBLE with getScale() returning 2. > See the test output for jdbcapi/metadata.java > double -- precision: 15 scale: 0 display size: 22 type name: DOUBLE > double precision - dec(10,2) -- precision: 15 scale: 0 display size: 22 type name: DOUBLE > dec(10,2) - double precision -- precision: 15 scale: 2 display size: 22 type name: DOUBLE > First line is a DOUBLE column, second is DOUBLE - DECIMAL, third is DECIMAL - DOUBLE > I assume the scale should always be zero for a DOUBLE, as it holds no meaning, but I can't see any proof of that in JDBC spec, javadoc or tutorial book. -- This message was sent by Atlassian JIRA (v6.3.4#6332)