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

[ADO.NET]The DbConnection.GetSchema(string) should throw an ArgumentException if the arg is specified as null.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: ADO.NET 9.3.0.0001
    • Fix Version/s: None
    • Component/s: ADO.NET
    • Labels:
    • Environment:

      Test Build: 9.3.0.0145
      Test OS: Windows 32bit
      .NET: 4.0
      Driver: cubrid-ado.net 9.3.0.0001(20140224)

      Description

      According to the DbConnection.GetSchema specification http://msdn.microsoft.com/en-us/library/22936zd1(v=vs.100).aspx, the GetSchema(string) should return an ArgumentException if the arg is specified as null, but currently it only return a System.Exception

      Scenario

      {code}
      CUBRIDConnection conn = new CUBRIDConnection()
      conn.ConnectionString = "server=localhost;database=demodb;port=33000;user=public;password=";
      conn.Open();

      try
      {
      dt = conn.GetSchema(null);
      }
      catch (ArgumentException e)
      {
      Console.WriteLine(e.Message);
      }{code}

      Actual Result: no error message, since the ArgumentException is not caught.

      Expect Result: The ArgumentException should be caught, and error message "The collectionName is specified as null.!" should be generated

      Currently, conn.GetSchema(null); throws a System.Exception, e.g.

      {code}
      try
      {
      dt = conn.GetSchema(null);
      }
      catch (Exception e)
      {
      Console.WriteLine(e.Message);
      }{code}

      Output: The collectionName is specified as null.!

        Activity

        Hide
        cn16359 唐勤 added a comment -

        Resolving Result
        Fixed. Throw ArgumentException if collectionName == null.

        Show
        cn16359 唐勤 added a comment - Resolving Result Fixed. Throw ArgumentException if collectionName == null.
        Hide
        ryin005 Ray Yin added a comment -

        Add a case for this issue

        RB-9.3.0

        {code}

        [TestMethod]
        public void APIS_727()
        {
        CUBRIDConnection conn = new CUBRIDConnection();
        conn.ConnectionString = "server=10.34.64.57;database=demodb;port=33146;user=dba;password=";

        try
        { DataTable dt = conn.GetSchema(null); }
        catch (ArgumentException e)
        { Console.WriteLine(e.Message); Assert.AreEqual("The collectionName is specified as null.!", e.Message); }
        }{code}

        Link: http://svn.bds.nhncorp.com/xdbms/cubridqa/branches/RB-9.3.0/interface/ADO.NET/unit_test/ADOTest/ADOTest/BTS_issue.cs

        Show
        ryin005 Ray Yin added a comment - Add a case for this issue RB-9.3.0 {code} [TestMethod] public void APIS_727() { CUBRIDConnection conn = new CUBRIDConnection(); conn.ConnectionString = "server=10.34.64.57;database=demodb;port=33146;user=dba;password="; try { DataTable dt = conn.GetSchema(null); } catch (ArgumentException e) { Console.WriteLine(e.Message); Assert.AreEqual("The collectionName is specified as null.!", e.Message); } }{code} Link: http://svn.bds.nhncorp.com/xdbms/cubridqa/branches/RB-9.3.0/interface/ADO.NET/unit_test/ADOTest/ADOTest/BTS_issue.cs
        Hide
        ryin005 Ray Yin added a comment -

        Test Build: 9.3.0.0165
        Test OS: Windows 32bit
        .NET: 4.0
        Driver: cubrid-ado.net 9.3.0.0001(20140409)

        Test Result: Pass

        Show
        ryin005 Ray Yin added a comment - Test Build: 9.3.0.0165 Test OS: Windows 32bit .NET: 4.0 Driver: cubrid-ado.net 9.3.0.0001(20140409) Test Result: Pass

          People

          • Assignee:
            cn16359 唐勤
            Reporter:
            ryin005 Ray Yin
            CC (Referrer):
            Esen Sagynov, Isaiah Choe, 唐勤, 户向伟, 范再强, 谢韦华[Bert]
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: