ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-9606) JDBC getPrimaryKeys() returns wrong value for COLUMN_NAME
Date Wed, 10 Oct 2018 15:13:00 GMT

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

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

    

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
    
----
commit 5d144b2f57933b96dc4ccb68be119f7c205bb6f7
Author: Pavel Kuznetsov <palmihal@...>
Date:   2018-10-02T14:43:31Z

    ignite-9606: Added test that reproduces the bug.

commit ee16f57dffe52fccaa6f2bba4e4546a343ca1581
Author: Pavel Kuznetsov <palmihal@...>
Date:   2018-10-10T14:54:49Z

    ignite-9606: updated test.

commit 34d70e7135e4a1548dc6a388b68148f29039cb57
Author: Pavel Kuznetsov <palmihal@...>
Date:   2018-10-10T14:56:27Z

    ignite-9606: fixed column name.
    
    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 {{getPrimaryKeys()}} method returns {{_KEY}} as column name rather than actual
column name. This breaks apps that expect a valid column name 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 = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/"))
{
>       // Create database tables.
>       try (Statement stmt = conn.createStatement()) {
>         stmt.executeUpdate("CREATE TABLE TESTER (" + " ID LONG PRIMARY KEY, NAME VARCHAR)
" + " WITH \"template=replicated\"");
>       }
>       // Get database metadata
>       DatabaseMetaData md = conn.getMetaData();
>       // Get primary keys
>       ResultSet rs = 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)

Mime
View raw message