From issues-return-78103-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Wed Oct 10 17:13:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 80A79180672 for ; Wed, 10 Oct 2018 17:13:03 +0200 (CEST) Received: (qmail 5545 invoked by uid 500); 10 Oct 2018 15:13:02 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 5536 invoked by uid 99); 10 Oct 2018 15:13:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Oct 2018 15:13:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 40A5F1A1093 for ; Wed, 10 Oct 2018 15:13:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id RbXcl7t28UUE for ; Wed, 10 Oct 2018 15:13:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1E83B5F41C for ; Wed, 10 Oct 2018 15:13:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8C495E02EB for ; Wed, 10 Oct 2018 15:13:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5579A24825 for ; Wed, 10 Oct 2018 15:13:00 +0000 (UTC) Date: Wed, 10 Oct 2018 15:13:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-9606) JDBC getPrimaryKeys() returns wrong value for COLUMN_NAME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-9606?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D166= 45121#comment-16645121 ]=20 ASF GitHub Bot commented on IGNITE-9606: ---------------------------------------- GitHub user pavel-kuznetsov opened a pull request: https://github.com/apache/ignite/pull/4948 IGNITE-9606: JDBC getPrimaryKeys() returns wrong value for COLUMN_NAME =20 You can merge this pull request into a Git repository by running: $ git pull https://github.com/gridgain/apache-ignite ignite-9606-simple Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/4948.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4948 =20 ---- commit 5d144b2f57933b96dc4ccb68be119f7c205bb6f7 Author: Pavel Kuznetsov Date: 2018-10-02T14:43:31Z ignite-9606: Added test that reproduces the bug. commit ee16f57dffe52fccaa6f2bba4e4546a343ca1581 Author: Pavel Kuznetsov Date: 2018-10-10T14:54:49Z ignite-9606: updated test. commit 34d70e7135e4a1548dc6a388b68148f29039cb57 Author: Pavel Kuznetsov Date: 2018-10-10T14:56:27Z ignite-9606: fixed column name. =20 Column name now looks in the keyFieldName before returning "_KEY". ---- > JDBC getPrimaryKeys() returns wrong value for COLUMN_NAME > --------------------------------------------------------- > > Key: IGNITE-9606 > URL: https://issues.apache.org/jira/browse/IGNITE-9606 > Project: Ignite > Issue Type: Bug > Components: jdbc > Affects Versions: 2.6 > Reporter: Pat Patterson > Assignee: Pavel Kuznetsov > Priority: Major > Fix For: 2.8 > > > JDBC=C2=A0{{getPrimaryKeys()}} method returns {{_KEY}} as column name rat= her than actual column name. This breaks apps that expect a valid column na= me as the primary key. > Trivially reproducible: > {noformat} > public static void main(String[] args) throws Exception { > // Register JDBC driver. > Class.forName("org.apache.ignite.IgniteJdbcThinDriver"); > // Open JDBC connection. > try (Connection conn =3D DriverManager.getConnection("jdbc:ignite:thi= n://127.0.0.1/")) { > // Create database tables. > try (Statement stmt =3D conn.createStatement()) { > stmt.executeUpdate("CREATE TABLE TESTER (" + " ID LONG PRIMARY KE= Y, NAME VARCHAR) " + " WITH \"template=3Dreplicated\""); > } > // Get database metadata > DatabaseMetaData md =3D conn.getMetaData(); > // Get primary keys > ResultSet rs =3D md.getPrimaryKeys(conn.getCatalog(), "", "TESTER")= ; > // > while (rs.next()) { > // Column 4 is COLUMN_NAME > System.out.println("Primary key column is " + rs.getString(4)); > } > } > } > {noformat} > Expected output is: > {noformat} > Primary key column is ID > {noformat} > Actual output is: > {noformat} > Primary key column is _KEY > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)