Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-196

Missing decrement of reference pointer (connection) when closing the cursor

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.10
    • 1.0.11
    • DBAPI 2.0
    • None
    • 3.8

    Description

      When closing a cursor the reference pointer for the corresponding connection object needs to be decremented to prevent leakage.

      How to repeat:

      import resource, mariadb
       
          ...
       
          def test_connection_ref(self):
              if is_maxscale():
                  self.skipTest("skip test (possible timeout)")
              last= 0
              for i in range(1,100000):
                  conn= create_connection()
                  cursor= conn.cursor()
                  cursor.close()
                  conn.close()
                  usage = resource.getrusage(resource.RUSAGE_SELF)
                  new= usage[2]
                  if (last > 0):
                      self.assertEqual(new, last)
                  last= new
      
      

      This doesn't affect Connector/Python 1.1.x

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              georg Georg Richter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.