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

user reported> ODBC driver has a Fetch error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: ODBC-Aprium
    • Component/s: ODBC
    • Labels:
      None

      Description

      http://www.cubrid.com/zbxe/304370 -> user issue
      he encountered the following error messages although he could get a right result.

      ERROR [HY000] [CUBRID][ODBC CUBRID Driver][-1006]Server handle not found
      ERROR [01000] [CUBRID][ODBC CUBRID Driver][0]Fetch error

      Mr Kang in DBMS lab is guessing that CCI-AUTOCOMMIT=ON should be related to ODBC's error. Because ODBC works in async mode, CCI's autocommit can cause those errors. Since CUBRID 8.4.1, autocommit=on is set by default.

        Issue Links

          Activity

          Hide
          zzoff zoran zoff added a comment -

          I get the same error nevertheless of autocommit setting.
          ODBC version 8.3.1 works correctly.

          Show
          zzoff zoran zoff added a comment - I get the same error nevertheless of autocommit setting. ODBC version 8.3.1 works correctly.
          Hide
          ryin005 Ray Yin added a comment - - edited

          ODBC 9.1.0 (20130422-14175366) works correctly whenever autocommit is on or off

          Test Case:

           
          //APIS-156
          [Test, Description("Test APIs issue 156 on ODBC-9.1.0")]
          public void ReviewIssueTest_APIs156()
          {
              string strConn = @"Driver={CUBRID Driver};db_name=odbc_test;uid=dba;pwd=;server=10.34.64.57;port=33037;fetch_size=100;charset=UTF-8;";
              OdbcConnection connCubrid = new OdbcConnection(strConn);
              connCubrid.Open();
                      
              string testTable = "test_apis156";
              string strCreateTable = string.Format("CREATE TABLE {0}(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f_string STRING)", testTable);
              string strDropTable = string.Format("DROP TABLE {0}", testTable);
          
              OdbcCommand cmdCubrid = connCubrid.CreateCommand();
              OdbcTransaction transaction = null;
              ExecuteMultiQueries(connCubrid, new string[] { strDropTable, strCreateTable });
          
              // Begin transaction
              transaction = connCubrid.BeginTransaction();
              cmdCubrid.Transaction = transaction;
          
              string test_string = "abcdefg";
              string test_string2 = "gfedcba";
              cmdCubrid.CommandText = string.Format("INSERT INTO {0}(f_string) VALUE('{1}')", testTable, test_string);
              cmdCubrid.ExecuteNonQuery();
              cmdCubrid.CommandText = string.Format("INSERT INTO {0}(f_string) VALUE('{1}')", testTable, test_string2);
              cmdCubrid.ExecuteNonQuery();
              transaction.Commit();
          
              // Check the result
              cmdCubrid.CommandText = string.Format("SELECT * FROM {0} WHERE f_string = '{1}';", testTable, test_string);
              OdbcDataReader reader = cmdCubrid.ExecuteReader();
              if (reader.Read())
              {
                  Assert.AreEqual(test_string, reader.GetString(1));
              }
          
              connCubrid.Close();
          }
          
          Show
          ryin005 Ray Yin added a comment - - edited ODBC 9.1.0 (20130422-14175366) works correctly whenever autocommit is on or off Test Case: //APIS-156 [Test, Description("Test APIs issue 156 on ODBC-9.1.0")] public void ReviewIssueTest_APIs156() { string strConn = @"Driver={CUBRID Driver};db_name=odbc_test;uid=dba;pwd=;server=10.34.64.57;port=33037;fetch_size=100;charset=UTF-8;"; OdbcConnection connCubrid = new OdbcConnection(strConn); connCubrid.Open(); string testTable = "test_apis156"; string strCreateTable = string.Format("CREATE TABLE {0}(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f_string STRING)", testTable); string strDropTable = string.Format("DROP TABLE {0}", testTable); OdbcCommand cmdCubrid = connCubrid.CreateCommand(); OdbcTransaction transaction = null; ExecuteMultiQueries(connCubrid, new string[] { strDropTable, strCreateTable }); // Begin transaction transaction = connCubrid.BeginTransaction(); cmdCubrid.Transaction = transaction; string test_string = "abcdefg"; string test_string2 = "gfedcba"; cmdCubrid.CommandText = string.Format("INSERT INTO {0}(f_string) VALUE('{1}')", testTable, test_string); cmdCubrid.ExecuteNonQuery(); cmdCubrid.CommandText = string.Format("INSERT INTO {0}(f_string) VALUE('{1}')", testTable, test_string2); cmdCubrid.ExecuteNonQuery(); transaction.Commit(); // Check the result cmdCubrid.CommandText = string.Format("SELECT * FROM {0} WHERE f_string = '{1}';", testTable, test_string); OdbcDataReader reader = cmdCubrid.ExecuteReader(); if (reader.Read()) { Assert.AreEqual(test_string, reader.GetString(1)); } connCubrid.Close(); }

            People

            • Assignee:
              cn15163 杨伟为[Astro]
              Reporter:
              cottonspan Laura Oh
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: