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

[python] The descriptions of Collection Datetypes are different in 32 bit linux and 64 bit linux

    Details

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

      Linux

      Description

      [python] The descriptions of Collection Datetypes are different in 32 bit linux and 64 bit linux

      Test case: http://svn.cubrid.org/cubridapis/python/branches/RB-9.1.0/tests2/python/_06_description/DescriptionTest.py

      cubrid Build: 9.1.0.0211
      Python driver: 9.1.0.001

      Test Codes

      {code}
      def test_desc_collection(self):
      # test description of collection type
      sqlSelect = "select * from collection_db"
      self.cur.execute(sqlSelect)
      dataDesc = self.cur.description
      dataCheck = (('c_set', 32, 0, 0, 8, 0, 0), ('c_multiset', 64, 0, 0, 8, 0, 0), ('c_sequence', 96, 0, 0, 8, 0, 0))
      self.assertEquals(dataCheck, dataDesc){code}

      Linux 64 Result:

      (('c_set', 32, 0, 0, 8, 0, 0), ('c_multiset', 64, 0, 0, 8, 0, 0), ('c_sequence', 96, 0, 0, 8, 0, 0))
      

      Linux 32 result:

      (('c_set', 32, 0, 0, 0, 0, 0), ('c_multiset', 64, 0, 0, 0, 0, 0), ('c_sequence', 96, 0, 0, 0, 0, 0))
      
      1. main_col.c
        4 kB
        谢韦华[Bert]

        Activity

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

        I have test cci-9.1.0 and cubrid 9.1.0.212, result as fllow:

        select started!
        DB Version is 9.1.0.0212
        Prepare ok!(1)
        Result column information
        ========================================
        name:c_set type:32(precision:0 scale:0)
        name:c_multiset type:64(precision:0 scale:0)
        name:c_sequence type:96(precision:0 scale:0)
        ========================================
        Query END!
        select ended!
        请按任意键继续. . .

        Show
        cn15800 谢韦华[Bert] added a comment - I have test cci-9.1.0 and cubrid 9.1.0.212, result as fllow: select started! DB Version is 9.1.0.0212 Prepare ok!(1) Result column information ======================================== name:c_set type:32(precision:0 scale:0) name:c_multiset type:64(precision:0 scale:0) name:c_sequence type:96(precision:0 scale:0) ======================================== Query END! select ended! 请按任意键继续. . .
        Hide
        cn15800 谢韦华[Bert] added a comment -

        http://www.python.org/dev/peps/pep-0249/#cursor-attributes

        Python interface define:
        name
        type_code
        display_size
        internal_size
        precision -------------> The wrong value
        scale
        null_ok

        But I have tested on windows/linux(32 and 64bit), there is not problem, The precision is 0, it is same with cci.

        Show
        cn15800 谢韦华[Bert] added a comment - http://www.python.org/dev/peps/pep-0249/#cursor-attributes Python interface define: name type_code display_size internal_size precision -------------> The wrong value scale null_ok But I have tested on windows/linux(32 and 64bit), there is not problem, The precision is 0, it is same with cci.
        Hide
        ryin005 Ray Yin added a comment - - edited

        The problem still occurs on Linux 32 / Linux 64 - the presision and scale values of Datatype are different between Linux 32 / Linux 64

        • Evironment:
          • OS: Linux 32 & Linux 64
          • Python: Python 2.6.6
          • Python Driver: RB-9.1.0 Revision 1877
          • CUBIRD: Linux 32 - CUBRID 9.1 (9.1.0.0212) (32bit release build for linux_gnu) (Mar 14 2013 01:07:26)
            Linux 64 - CUBRID 9.1 (9.1.0.0212) (64bit release build for linux_gnu) (Mar 14 2013 00:16:33)
        • Testcase
          import unittest
          import CUBRIDdb
          import locale
          import time
          from xml.dom import minidom
          
          class FetchoneDescriptionTest(unittest.TestCase):
          
          	def setUp(self):
                          conStr="CUBRID:localhost:33000:test_python:::"
                          self.con = CUBRIDdb.connect(conStr, "dba","")		
                          self.cur = self.con.cursor()
          		sqlDrop = "drop table if exists collection_db"
          		self.cur.execute(sqlDrop)
          
          	def tearDown(self):
                          sqlDrop = "drop table if exists collection_db"
          		self.cur.execute(sqlDrop)
          		self.cur.close
          		self.con.close
          
                  def test_desc_collection(self):
          #               test description of collection type
                          conStr="CUBRID:localhost:33000:test_python:::"
                          self.con = CUBRIDdb.connect(conStr, "dba","")
                          self.cur = self.con.cursor()
                          sqlCreate = "create table collection_db(c_set set,c_multiset multiset, c_sequence sequence)"
                          self.cur.execute(sqlCreate)
                          
                          sqlSelect = "select * from collection_db"
                          self.cur.execute(sqlSelect)
                          dataDesc = self.cur.description
                          dataCheck = (('c_set', 32, 0, 0, 8, 0, 0), ('c_multiset', 64, 0, 0, 8, 0, 0), ('c_sequence', 96, 0, 0, 8, 0, 0))
                          self.assertEquals(dataCheck, dataDesc)
          
          if __name__ == '__main__':
          	suite = unittest.TestLoader().loadTestsFromTestCase(FetchoneDescriptionTest)
          	unittest.TextTestRunner(verbosity=2).run(suite)
          
        • Result
          • Linux 64 result
            [python@NC-PL-QA015 _06_description]$ python apis_489.py 
            test_desc_collection (__main__.FetchoneDescriptionTest) ... ok
            
            ----------------------------------------------------------------------
            Ran 1 test in 0.054s
            
            OK
            
          • Linux 32 result
            [irteamsu@dev-cub-ha-001.ncl _06_description]$ python apis_489.py 
            test_desc_collection (__main__.FetchoneDescriptionTest) ... FAIL
            
            ======================================================================
            FAIL: test_desc_collection (__main__.FetchoneDescriptionTest)
            ----------------------------------------------------------------------
            Traceback (most recent call last):
              File "apis_489.py", line 34, in test_desc_collection
                self.assertEquals(dataCheck, dataDesc)
            AssertionError: (('c_set', 32, 0, 0, 8, 0, 0), ('c_multiset', 64, 0, 0, 8, 0, 0), ('c_sequence', 96, 0, 0, 8, 0, 0)) != (('c_set', 32, 0, 0, 163201648, 78, 0), ('c_multiset', 64, 0, 0, 163201648, 78, 0), ('c_sequence', 96, 0, 0, 163201648, 78, 0))
            
            ----------------------------------------------------------------------
            Ran 1 test in 0.044s
            
            FAILED (failures=1)
            
        Show
        ryin005 Ray Yin added a comment - - edited The problem still occurs on Linux 32 / Linux 64 - the presision and scale values of Datatype are different between Linux 32 / Linux 64 Evironment: OS: Linux 32 & Linux 64 Python: Python 2.6.6 Python Driver: RB-9.1.0 Revision 1877 CUBIRD: Linux 32 - CUBRID 9.1 (9.1.0.0212) (32bit release build for linux_gnu) (Mar 14 2013 01:07:26) Linux 64 - CUBRID 9.1 (9.1.0.0212) (64bit release build for linux_gnu) (Mar 14 2013 00:16:33) Testcase import unittest import CUBRIDdb import locale import time from xml.dom import minidom class FetchoneDescriptionTest(unittest.TestCase): def setUp(self): conStr="CUBRID:localhost:33000:test_python:::" self.con = CUBRIDdb.connect(conStr, "dba","") self.cur = self.con.cursor() sqlDrop = "drop table if exists collection_db" self.cur.execute(sqlDrop) def tearDown(self): sqlDrop = "drop table if exists collection_db" self.cur.execute(sqlDrop) self.cur.close self.con.close def test_desc_collection(self): # test description of collection type conStr="CUBRID:localhost:33000:test_python:::" self.con = CUBRIDdb.connect(conStr, "dba","") self.cur = self.con.cursor() sqlCreate = "create table collection_db(c_set set,c_multiset multiset, c_sequence sequence)" self.cur.execute(sqlCreate) sqlSelect = "select * from collection_db" self.cur.execute(sqlSelect) dataDesc = self.cur.description dataCheck = (('c_set', 32, 0, 0, 8, 0, 0), ('c_multiset', 64, 0, 0, 8, 0, 0), ('c_sequence', 96, 0, 0, 8, 0, 0)) self.assertEquals(dataCheck, dataDesc) if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(FetchoneDescriptionTest) unittest.TextTestRunner(verbosity=2).run(suite) Result Linux 64 result [python@NC-PL-QA015 _06_description]$ python apis_489.py test_desc_collection (__main__.FetchoneDescriptionTest) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.054s OK Linux 32 result [irteamsu@dev-cub-ha-001.ncl _06_description]$ python apis_489.py test_desc_collection (__main__.FetchoneDescriptionTest) ... FAIL ====================================================================== FAIL: test_desc_collection (__main__.FetchoneDescriptionTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "apis_489.py", line 34, in test_desc_collection self.assertEquals(dataCheck, dataDesc) AssertionError: (('c_set', 32, 0, 0, 8, 0, 0), ('c_multiset', 64, 0, 0, 8, 0, 0), ('c_sequence', 96, 0, 0, 8, 0, 0)) != (('c_set', 32, 0, 0, 163201648, 78, 0), ('c_multiset', 64, 0, 0, 163201648, 78, 0), ('c_sequence', 96, 0, 0, 163201648, 78, 0)) ---------------------------------------------------------------------- Ran 1 test in 0.044s FAILED (failures=1)
        Hide
        cn15800 谢韦华[Bert] added a comment -

        I have test c program, the value return by cci is not right. Main_col.c is an example.

        I have catch packet by wireshark, the packet return by cubrid 32bit is different with cubrid 64 bit, so i think the bug is case by cubrid engine。

        Show
        cn15800 谢韦华[Bert] added a comment - I have test c program, the value return by cci is not right. Main_col.c is an example. I have catch packet by wireshark, the packet return by cubrid 32bit is different with cubrid 64 bit, so i think the bug is case by cubrid engine。

          People

          • Assignee:
            jinhu 李金虎
            Reporter:
            cn14130 欧明宝[Bom Owen]
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: