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

GET TRANSACTION ISOLATION LEVEL returns None object

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Python 9.1.0.p1
    • Component/s: Python Driver
    • Labels:
      None
    • Environment:

      Any

      Description

      Running the following python code:

      {code}
      cursor = connection.cursor()
      cursor.execute('GET TRANSACTION ISOLATION LEVEL')
      print cursor.fetchone(){code}

      Returns "None", even though in CSQL the result obtained is:

      {code}
      csql> GET TRANSACTION ISOLATION LEVEL;

      === <Result of GET ISOLATION LEVEL Command in Line 1> ===

      Result
      =============
      REPEATABLE READ SCHEMA, READ UNCOMMITTED INSTANCES


      Current transaction has been committed.

      1 command(s) successfully processed.{code}

        Activity

        Hide
        jinhu 李金虎 added a comment -

        The reson of this bug is in CCI. The test_execute_get_isolationlevel.c is the test case.
        When running this test case, the result is as below:
        result count: 0
        test_execute_get_isolationlevel.c(36): cci_get_result_info fail

        Please register a CCI bug.

        Show
        jinhu 李金虎 added a comment - The reson of this bug is in CCI. The test_execute_get_isolationlevel.c is the test case. When running this test case, the result is as below: result count: 0 test_execute_get_isolationlevel.c(36): cci_get_result_info fail Please register a CCI bug.
        Hide
        cn14130 欧明宝[Bom Owen] added a comment -

        CCI issue: CUBRIDSUS-10801

        Show
        cn14130 欧明宝[Bom Owen] added a comment - CCI issue: CUBRIDSUS-10801
        Hide
        ryin005 Ray Yin added a comment -

        I have tested the issue on the python and ODBC drivers, they all return the same results (None)

        Python Test case:

        import unittest
        import CUBRIDdb
        import time
        import locale
        from xml.dom import minidom
        
        class apis_92_test(unittest.TestCase):
            def setUp(self):
                    conStr="CUBRID:localhost:33188:test_python:::"
                    self.con = CUBRIDdb.connect(conStr, "dba","")        
                    self.cur = self.con.cursor()
                    self.con.set_autocommit(True)
        
            def tearDown(self):
                    self.cur.close
                    self.con.close
        
            def test_transaction_isolation(self):
                    trans_query = "GET TRANSACTION ISOLATION LEVEL"
                    self.cur.execute(trans_query)
                    dataReturn = self.cur.fetchone()
                    self.assertEquals("REPEATABLE READ SCHEMA, READ UNCOMMITTED INSTANCES", dataReturn)
                    
        
        if __name__ == '__main__':
            suite = unittest.TestLoader().loadTestsFromTestCase(apis_92_test)
            unittest.TextTestRunner(verbosity=2).run(suite)
        
        

        ODBC Test case

        [Test, Description("Test APIs issue 274 on ODBC-9.1.0")]
        public void ReviewIssueTest_APIs274()
        {
            string strConn = @"Driver={CUBRID Driver};db_name=test_python;uid=dba;pwd=;server=10.34.64.61;port=33188;fetch_size=100;charset=UTF-8;";
            OdbcConnection connCubrid = new OdbcConnection(strConn);
            connCubrid.Open();
        
        
            string trans_query = string.Format("GET TRANSACTION ISOLATION LEVEL");
            OdbcCommand command = new OdbcCommand();
            command.Connection = connCubrid;
            command.CommandText = trans_query;
        
            OdbcDataReader odbcReader = command.ExecuteReader();
            while (odbcReader.Read())
            {
                Console.WriteLine(odbcReader.GetString(0));
            }
        
            connCubrid.Close();
        }
        

        So it could be a CCI issue but not a python driver's bug

        Show
        ryin005 Ray Yin added a comment - I have tested the issue on the python and ODBC drivers, they all return the same results (None) Python Test case: import unittest import CUBRIDdb import time import locale from xml.dom import minidom class apis_92_test(unittest.TestCase): def setUp(self): conStr="CUBRID:localhost:33188:test_python:::" self.con = CUBRIDdb.connect(conStr, "dba","") self.cur = self.con.cursor() self.con.set_autocommit(True) def tearDown(self): self.cur.close self.con.close def test_transaction_isolation(self): trans_query = "GET TRANSACTION ISOLATION LEVEL" self.cur.execute(trans_query) dataReturn = self.cur.fetchone() self.assertEquals("REPEATABLE READ SCHEMA, READ UNCOMMITTED INSTANCES", dataReturn) if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(apis_92_test) unittest.TextTestRunner(verbosity=2).run(suite) ODBC Test case [Test, Description("Test APIs issue 274 on ODBC-9.1.0")] public void ReviewIssueTest_APIs274() { string strConn = @"Driver={CUBRID Driver};db_name=test_python;uid=dba;pwd=;server=10.34.64.61;port=33188;fetch_size=100;charset=UTF-8;"; OdbcConnection connCubrid = new OdbcConnection(strConn); connCubrid.Open(); string trans_query = string.Format("GET TRANSACTION ISOLATION LEVEL"); OdbcCommand command = new OdbcCommand(); command.Connection = connCubrid; command.CommandText = trans_query; OdbcDataReader odbcReader = command.ExecuteReader(); while (odbcReader.Read()) { Console.WriteLine(odbcReader.GetString(0)); } connCubrid.Close(); } So it could be a CCI issue but not a python driver's bug

          People

          • Assignee:
            cn14130 欧明宝[Bom Owen]
            Reporter:
            ovidiu.veliscu Veliscu Ovidiu
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: