Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-668

[ADO.NET] CUBRIDDataReader.NextResult() doesn't work correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: ADO.NET 9.2.0.0001
    • Fix Version/s: ADO.NET 9.2.0.0002
    • Component/s: ADO.NET
    • Labels:
    • Environment:
      • OS: Win32
      • CUBRID: 9.2.0.0149
      • Driver: cubrid-ado.net 9.2.0.0001 (20130911)
      • Framework: .NET 4.0

      Description

      • Brief: CUBRIDDataReader.NextResult() always return false even if the reader still has data
      • Test Code
        string conn_string = "server=xx.xx.xx.xx;database=demodb;port=33000;user=dba;password=";
        CUBRIDConnection conn = new CUBRIDConnection();
        conn.ConnectionString = conn_string;
        conn.Open();
        
        String sql = "select * from nation;";
        CUBRIDCommand cmd = new CUBRIDCommand(sql, conn);
        
        CUBRIDDataReader reader = (CUBRIDDataReader)cmd.ExecuteReader();
        reader.Read();
        Console.WriteLine(reader.GetString(0));
        
        if (reader.NextResult())
        {
            reader.Read();
            Console.WriteLine(reader.GetString(0));
        }
        
        conn.Close();
        

      Expected Result

      SRB
      KIR
      

      Actual Result

      SRB
      

      demodb nation table data

      csql> select * from nation;
      
      === <Result of SELECT Command in Line 1> ===
      
        code                  name                  continent             capital             
      ========================================================================================
        'SRB'                 'Serbia'              'Europe'              'Beograd'           
        'KIR'                 'Kiribati'            'Oceania'             'Tarawa'            
        'SCG'                 'Serbia and Montenegro'  'Europe'              'Beograd'           
        'TLS'                 'Timor-Leste'         'Asia'                'Dili'       
      x
      x
      x
      

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        The correct test code

        {code}
        String sql = "select * from nation;";
        CUBRIDCommand cmd = new CUBRIDCommand(sql, conn);

        CUBRIDDataReader reader = (CUBRIDDataReader)cmd.ExecuteReader();
        reader.Read();
        Console.WriteLine(reader.GetString(0));

        if (reader.Read())
        { Console.WriteLine(reader.GetString(0)); }{code}
        Show
        cn15800 谢韦华[Bert] added a comment - The correct test code {code} String sql = "select * from nation;"; CUBRIDCommand cmd = new CUBRIDCommand(sql, conn); CUBRIDDataReader reader = (CUBRIDDataReader)cmd.ExecuteReader(); reader.Read(); Console.WriteLine(reader.GetString(0)); if (reader.Read()) { Console.WriteLine(reader.GetString(0)); }{code}
        Hide
        cn15800 谢韦华[Bert] added a comment -

        There is only one result in your test code

        Show
        cn15800 谢韦华[Bert] added a comment - There is only one result in your test code
        Hide
        ryin005 Ray Yin added a comment -

        The problem is caused by reader.NextResult(), the query "select * from nation;" has mulitple results, but the reader.NextResult() always return false

        Show
        ryin005 Ray Yin added a comment - The problem is caused by reader.NextResult() , the query "select * from nation;" has mulitple results, but the reader.NextResult() always return false
        Hide
        cn15800 谢韦华[Bert] added a comment -

        mulitple results? what is the second result?

        If there is two results, it is same with APIS-378, now cubrid driver can not support mulitple results

        Show
        cn15800 谢韦华[Bert] added a comment - mulitple results? what is the second result? If there is two results, it is same with APIS-378 , now cubrid driver can not support mulitple results
        Hide
        ryin005 Ray Yin added a comment -

        The NextResult() focuses on the resultset (from multiple quries) but not the next record(data). Since the current ADO.NET driver doesn't support execute multiple-quries APIS-669, APIS-378, the NextResult() would not be able to work correctly at the moment

        This feature is assigned to by design, but we need to solve it in the next version

        Show
        ryin005 Ray Yin added a comment - The NextResult() focuses on the resultset (from multiple quries) but not the next record(data). Since the current ADO.NET driver doesn't support execute multiple-quries APIS-669 , APIS-378 , the NextResult() would not be able to work correctly at the moment This feature is assigned to by design, but we need to solve it in the next version
        Hide
        cn15800 谢韦华[Bert] added a comment -

        fixed, it is same with 378

        Show
        cn15800 谢韦华[Bert] added a comment - fixed, it is same with 378
        Hide
        ryin005 Ray Yin added a comment -
        • Test OS: Windows 32/64bits
        • CUBRID: 9.2.0.0155
        • Driver: cubrid-ado.net 9.2.0.0002
        • Framework: .NET 4.0

        Test Result: Pass

        Close the issue

        Show
        ryin005 Ray Yin added a comment - Test OS: Windows 32/64bits CUBRID: 9.2.0.0155 Driver: cubrid-ado.net 9.2.0.0002 Framework: .NET 4.0 Test Result: Pass Close the issue

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            ryin005 Ray Yin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: