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

[Python]Error information is not correct

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: Python 9.1.0.p1
    • Component/s: Python Driver
    • Labels:
      None

      Description

      Test Build:CUBRID 2008 R4.2 (8.4.2.0022)
      OS: Linux 64
      Description
      when passing a string to a int column, the error information is "ERROR: DBMS, -494, No error message available."

      Statements in test_issue.py

      self.cur.execute("CREATE TABLE issue(nameid int primary key ,age int,name VARCHAR(40))")
      
      try:
          self.cur.execute("insert into issue values(?,?,?)",(8,'58aaa','aaaa'))
      except Exception,e:
          errorValue=str(e)
          print errorValue
      

      Repro Steps:
      python test_issue.py

      Actual result:

      test_executeParam (__main__.IssueTest) ... 
      parameter's value is not corret
      (-1, 'ERROR: DBMS, -494, No error message available.')
      ok
      

      Expect result:
      Maybe the error information is "ERROR: DBMS, -494, Semantic: Cannot coerce host var to type integer."

        Activity

        Hide
        hellohuizhang 张慧 added a comment -

        I have tested CCI on CUBRID-8.4.1.1008, CUBRID-8.4.1.3018 and CUBRID-8.4.2.0025.

        On CUBRID-8.4.1.1008, CCI will give the error message "-494, Semantic: Cannot coerce host var to type integer."

        On CUBRID-8.4.1.3018 and CUBRID-8.4.2.0025, CCI will give the error message "-494, No error message available."

        Show
        hellohuizhang 张慧 added a comment - I have tested CCI on CUBRID-8.4.1.1008, CUBRID-8.4.1.3018 and CUBRID-8.4.2.0025. On CUBRID-8.4.1.1008, CCI will give the error message "-494, Semantic: Cannot coerce host var to type integer." On CUBRID-8.4.1.3018 and CUBRID-8.4.2.0025, CCI will give the error message "-494, No error message available."
        Hide
        xiaoshan78 李成龙[이성룡] added a comment -

        It is CCI issue, please commit to CUBRIDSUS

        Show
        xiaoshan78 李成龙[이성룡] added a comment - It is CCI issue, please commit to CUBRIDSUS
        Hide
        cn15800 谢韦华[Bert] added a comment -

        I have test cubrid-9.1.0, there is not the problem.

        Show
        cn15800 谢韦华[Bert] added a comment - I have test cubrid-9.1.0, there is not the problem.
        Hide
        ryin005 Ray Yin added a comment -

        Test the issue by the below case:

        • Environment:
          • OS: Linux 64/32, Windows 64/32
          • Server Version: CUBRID 9.1.0.0212 (Linux 64/32, windows 64/32)
          • Driver Version: cubrid-python-9.1.0.p1.tar.gz (2013-05-22)
        • Test Case
          import unittest
          import CUBRIDdb
          import time
          import locale
          from xml.dom import minidom
          
          class apis_180_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_error_info(self):
                      self.cur.execute("DROP TABLE IF EXISTS issue")
                      self.cur.execute("CREATE TABLE issue(nameid int primary key ,age int,name VARCHAR(40))")
                      try:
                          self.cur.execute("insert into issue values(?,?,?)",(8,'58aaa','aaaa'))
                      except CUBRIDdb.DatabaseError, e:
                          errorValue = str(e)
                      
                      self.assertEquals(errorValue,"(-494, \'ERROR: DBMS, -494, Semantic: Cannot coerce host var to type integer. \')")
          
          if __name__ == '__main__':
              suite = unittest.TestLoader().loadTestsFromTestCase(apis_180_test)
              unittest.TextTestRunner(verbosity=2).run(suite)
          

        Results: Pass

        Show
        ryin005 Ray Yin added a comment - Test the issue by the below case: Environment: OS: Linux 64/32, Windows 64/32 Server Version: CUBRID 9.1.0.0212 (Linux 64/32, windows 64/32) Driver Version: cubrid-python-9.1.0.p1.tar.gz (2013-05-22) Test Case import unittest import CUBRIDdb import time import locale from xml.dom import minidom class apis_180_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_error_info(self): self.cur.execute("DROP TABLE IF EXISTS issue") self.cur.execute("CREATE TABLE issue(nameid int primary key ,age int,name VARCHAR(40))") try: self.cur.execute("insert into issue values(?,?,?)",(8,'58aaa','aaaa')) except CUBRIDdb.DatabaseError, e: errorValue = str(e) self.assertEquals(errorValue,"(-494, \'ERROR: DBMS, -494, Semantic: Cannot coerce host var to type integer. \')") if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(apis_180_test) unittest.TextTestRunner(verbosity=2).run(suite) Results: Pass

          People

          • Assignee:
            jinhu 李金虎
            Reporter:
            zoujing ZouJing
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: