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-9342) The same SQL request with multiple statements produces different result
Date Mon, 29 Oct 2018 13:59:00 GMT

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

ASF GitHub Bot commented on IGNITE-9342:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/ignite/pull/4709


> 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)

Mime
View raw message