You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2018/10/29 13:51:01 UTC

[jira] [Updated] (IGNITE-9342) The same SQL request with multiple statements produces different result

     [ https://issues.apache.org/jira/browse/IGNITE-9342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Ozerov updated IGNITE-9342:
------------------------------------
    Fix Version/s: 2.8

> The same SQL request with multiple statements produces different result
> -----------------------------------------------------------------------
>
>                 Key: IGNITE-9342
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9342
>             Project: Ignite
>          Issue Type: Bug
>          Components: jdbc, odbc, sql
>    Affects Versions: 2.6
>            Reporter: Igor Sapego
>            Assignee: Taras Ledkov
>            Priority: Major
>             Fix For: 2.8
>
>
> The bug affects ODBC and JDBC. Simply speaking, the following code:
> {code:java}
> public static void main(String[] args) throws Exception {
>     IgniteConfiguration cfg = new IgniteConfiguration();
>     cfg.setLocalHost("127.0.0.1");
>     try (Ignite ignite = Ignition.start(cfg)) {
>         try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/")) {
>             // Populate City table with PreparedStatement.
>             try (PreparedStatement stmt = conn.prepareStatement("SELECT 1; SELECT 2")) {
>                 System.out.println("First run:");
>                 executeAndFetch(stmt);
>                 System.out.println();
>                 System.out.println("Second run:");
>                 executeAndFetch(stmt);
>             }
>         }
>     }
> }
> static void executeAndFetch(PreparedStatement stmt) throws SQLException {
>     ResultSet set = stmt.executeQuery();
>     System.out.println(">>>  First result set:");
>     while (set.next())
>         System.out.println(">>>    " + set.getInt(1));
>     System.out.println(">>>  Next result set:");
>     boolean nextRsPresent = stmt.getMoreResults();
>     if (!nextRsPresent)
>         System.out.println(">>>    Is not present");
>     else
>     {
>         set = stmt.getResultSet();
>         while (set.next())
>             System.out.println(">>>    " + set.getInt(1));
>     }
> }
> {code}
> Produces the following output:
> {noformat}
> First run:
> >>>  First result set:
> >>>    1
> >>>  Next result set:
> >>>    2
> Second run:
> >>>  First result set:
> >>>    1
> >>>  Next result set:
> >>>    Is not present{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)