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 43049200B40 for ; Wed, 1 Jun 2016 19:08:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 41E67160A45; Wed, 1 Jun 2016 17:08:01 +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 9229B160A4C for ; Wed, 1 Jun 2016 19:08:00 +0200 (CEST) Received: (qmail 44069 invoked by uid 500); 1 Jun 2016 17:07:59 -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 43780 invoked by uid 99); 1 Jun 2016 17:07:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jun 2016 17:07:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6771C2C1F5D for ; Wed, 1 Jun 2016 17:07:59 +0000 (UTC) Date: Wed, 1 Jun 2016 17:07:59 +0000 (UTC) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DERBY-3181) isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 01 Jun 2016 17:08:01 -0000 [ https://issues.apache.org/jira/browse/DERBY-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Pendleton resolved DERBY-3181. ------------------------------------ Resolution: Fixed Fix Version/s: 10.13.0.0 We've completed the intended work for this issue; resolving. > isNullable on ResultSetMetaData from DatabaseMetaData.getBestRowIdentifier values are opposite when there is no rows in ResultSet vs. when there is a row. > ---------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-3181 > URL: https://issues.apache.org/jira/browse/DERBY-3181 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.4.1.3 > Reporter: Myrna van Lunteren > Assignee: Danoja Dias > Priority: Trivial > Labels: derby_triage10_5_2 > Fix For: 10.13.0.0 > > Attachments: Derby-3181.diff, Derby3181.diff, deleteQuery.diff, repro.java, testChange.diff > > > With code like the following: > DatabaseMetaData dmd = conn.getMetaData(); > ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",3,true); > ResultSetMetaData rsmd = rs.getMetaData(); > int actualCols = rsmd.getColumnCount(); > for (int i = 0; i < actualCols; i++) > { > System.out.print("getColumnName: " + rsmd.getColumnName(i+1) + ", isNullable: "); > System.out.println(rsmd.isNullable(i+1)); > } > The printed values for isNullable returned are opposite of what they are when the getBestRowIdentifier call looks like this: > ResultSet rs = dmd.getBestRowIdentifier(null,"APP","a",1,true); > In the latter case, the values are: > getColumnName: SCOPE, isNullable: 0 > getColumnName: COLUMN_NAME, isNullable: 1 > getColumnName: DATA_TYPE, isNullable: 0 > getColumnName: TYPE_NAME, isNullable: 1 > getColumnName: COLUMN_SIZE, isNullable: 0 > getColumnName: BUFFER_LENGTH, isNullable: 0 > getColumnName: DECIMAL_DIGITS, isNullable: 0 > getColumnName: PSEUDO_COLUMN, isNullable: 0 > In the first case, the values are: > getColumnName: SCOPE, isNullable: 1 > getColumnName: COLUMN_NAME, isNullable: 0 > getColumnName: DATA_TYPE, isNullable: 1 > getColumnName: TYPE_NAME, isNullable: 1 > getColumnName: COLUMN_SIZE, isNullable: 1 > getColumnName: BUFFER_LENGTH, isNullable: 1 > getColumnName: DECIMAL_DIGITS, isNullable: 1 > getColumnName: PSEUDO_COLUMN, isNullable: 1 > The isNullable value should be stable. > It's probably worthwhile verifying what the value *should* be in the first place. -- This message was sent by Atlassian JIRA (v6.3.4#6332)