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

[ODBC][Shard] OdbcCommand.ExecuteNonQuery() throws an undesired exception when execute shard sql INSERT/UPDATE/DELETE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: ODBC-9.2.0.0001
    • Fix Version/s: ODBC-9.2.0.0001
    • Component/s: ODBC
    • Labels:
    • Environment:
      • OS: Linux 64bit (Server), Win7 32bit(Client)
      • CUBRID: 9.2.0.0128
      • Driver: cubrid-pdbc 9.2.0.0001 (20130813)
      • Framework: .NET 4.0

      Description

      • Brief: The odbc_command.ExecuteNonQuery() throws an undesired exception when execute shard sql INSERT/UPDATE/DELETE queries, even though the data has been executed successfully
      • Test Code
        CUBRID shard db configration: see attachment
      {code}
      // Open Shard Connection
      string strConn = @"Driver={CUBRID Driver};db_name=shard1;uid=dba;pwd=;server=10.34.64.57;port=36069;fetch_size=100";
      OdbcConnection connCubrid = new OdbcConnection(strConn);
      connCubrid.Open();

      OdbcCommand odbc_command = new OdbcCommand("", connCubrid);

      // insert data to shard db
      try
      {
      // you need to first create a table on shard1, "CREATE TABLE odbc_shard (id int);"
      string strInsert = "INSERT INTO odbc_shard VALUES(/*+ shard_key */ 1)";
      odbc_command.CommandText = strInsert;
      odbc_command.ExecuteNonQuery();
      }
      catch (OdbcException e)
      {
      Console.WriteLine(e.Message);
      }

      // update data on shard db
      try
      {
      string strUpdate = "UPDATE odbc_shard SET id=2 WHERE id = /*+ shard_key */ 1";
      odbc_command.CommandText = strUpdate;
      odbc_command.ExecuteNonQuery();
      }
      catch (OdbcException e)
      {
      Console.WriteLine(e.Message);
      }

      // delete data from shard db
      try
      {
      string strDelete = "DELETE from odbc_shard WHERE id = /*+ shard_key */ 1";
      odbc_command.CommandText = strDelete;
      odbc_command.ExecuteNonQuery();
      }
      catch (OdbcException e)
      {
      Console.WriteLine(e.Message);
      }{code}

      The data will be executed on shard db correctly (INSERT/UPDATE/DELETE), but we will get the undesired exception

      • Expected Result: NO exceptions are thrown
      • Actual Result:
        ERROR [HY000] [CUBRID][ODBC CUBRID Driver][-10100]Unknown error
        ERROR [HY000] [CUBRID][ODBC CUBRID Driver][-10100]Unknown error
        ERROR [HY000] [CUBRID][ODBC CUBRID Driver][-10100]Unknown error
        
      1. cubrid_broker.conf
        2 kB
        Ray Yin
      2. shard_connection.txt
        0.5 kB
        Ray Yin
      3. shard_key.txt
        0.2 kB
        Ray Yin

        Activity

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

        Driver should't throw exception when cci_next_result return CAS_ER_NOT_IMPLEMENTED.

        Show
        cn15800 谢韦华[Bert] added a comment - Driver should't throw exception when cci_next_result return CAS_ER_NOT_IMPLEMENTED.
        Hide
        cn15800 谢韦华[Bert] added a comment -

        fixed

        Show
        cn15800 谢韦华[Bert] added a comment - fixed
        Hide
        ryin005 Ray Yin added a comment -
        • Test OS: Win7 32bit, WinXP 64bit, Linux 64bit (Server)
        • CUBRID: 9.2.0.0128
        • Driver: cubrid-odbc 9.2.0.0001 (20130815)
        • Framework: .NET 4.0

        Test Result: Pass

        Close the issue

        Show
        ryin005 Ray Yin added a comment - Test OS: Win7 32bit, WinXP 64bit, Linux 64bit (Server) CUBRID: 9.2.0.0128 Driver: cubrid-odbc 9.2.0.0001 (20130815) 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: