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

[Python] Cannot connect to the shard db in python driver

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Python 9.2.0.0001
    • Fix Version/s: Python 9.2.0.0001
    • Component/s: Python Driver
    • Labels:
    • Environment:
      • OS: Linux 64bit
      • CUBRID: 9.2.0.0123
      • Python: v2.6.5
      • Driver: cubrid-python 9.2.0.0001 (20130808)

      Description

      • Brief: We can not use python driver to connect with cubrid shard db
      • CUBRID Shard Configuration: please see the attachments
      • Test Code {code}
        import unittest
        import _cubrid
        from _cubrid import *
        import time

        class pythonShard(unittest.TestCase):

        def test_shard_connection(self):
        con = _cubrid.connect('CUBRID:10.34.64.58:36057:shard1:::', 'dba', '')
        print (con)
        con.close()


        if _name_ == '_main_':
        suite = unittest.TestLoader().loadTestsFromTestCase(pythonShard)
        unittest.TextTestRunner(verbosity=2).run(suite){code}

      Expected Result

      The connection has been built successfully 
      

      Actual Result

      ======================================================================
      ERROR: test_shard_connection (__main__.pythonShard)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "python_shard.py", line 9, in test_shard_connection
          con = _cubrid.connect('CUBRID:10.34.64.58:36057:shard1:::', 'dba', '')
      InterfaceError: (-20004, 'ERROR: CCI, -20004, Cannot communicate with server')
      
      ----------------------------------------------------------------------
      
      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 -

        In sharding environment, when driver call function cci_get_db_parameter(CCI_PARAM_MAX_STRING_LENGTH), an error will be thrown by cci:

        -20004:Cannot communicate with server[CAS INFO - 10.34.64.218:36069, 1, 31236].

        So when the cci_get_db_parameter(CCI_PARAM_MAX_STRING_LENGTH) function return failed, ignore it.

        Show
        cn15800 谢韦华[Bert] added a comment - In sharding environment, when driver call function cci_get_db_parameter(CCI_PARAM_MAX_STRING_LENGTH), an error will be thrown by cci: -20004:Cannot communicate with server [CAS INFO - 10.34.64.218:36069, 1, 31236] . So when the cci_get_db_parameter(CCI_PARAM_MAX_STRING_LENGTH) function return failed, ignore it.
        Hide
        ryin005 Ray Yin added a comment -
        • Test OS: Linux 64bit
        • CUBRID: 9.2.0.0128
        • Python: 2.6.5
        • Driver: cubrid-python 9.2.0.0001 (20130813)

        Test Result: Pass, the python driver can connect with CUBRID shard db properly

        Close the issue

        Show
        ryin005 Ray Yin added a comment - Test OS: Linux 64bit CUBRID: 9.2.0.0128 Python: 2.6.5 Driver: cubrid-python 9.2.0.0001 (20130813) Test Result: Pass, the python driver can connect with CUBRID shard db properly 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: