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

memory leaks with prepared statement cache (mariadb_c)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 2.0.0-rc
    • None
    • Other
    • None

    Description

      If the prepared statement cache is enabled (current default) valgrind reports a huge amount of memory leaks:

      def test_bulk_delete(self):
              if is_maxscale():
                  self.skipTest("MAXSCALE doesn't support BULK yet")
              with create_connection({"cache_prep_stmts" : True}) as connection:
                  cursor = connection.cursor()
                  cursor.execute("CREATE TEMPORARY TABLE bulk_delete ("
                                 "id int, name varchar(64), city varchar(64))")
                  params = [(1, u"Jack", u"Boston"),
                            (2, u"Martin", u"Ohio"),
                            (3, u"James", u"Washington"),
                            (4, u"Rasmus", u"Helsinki"),
                            (5, u"Andrey", u"Sofia")]
                  cursor.executemany("INSERT INTO bulk_delete VALUES (?,?,?)", params)
                  self.assertEqual(cursor.rowcount, 5)
                  params = [(1,), (2,)]
                  cursor.executemany("DELETE FROM bulk_delete WHERE id=?", params)
                  self.assertEqual(cursor.rowcount, 2)
                  cursor.close()
      

      Valgrind summary:

      ==16705== LEAK SUMMARY:
      ==16705==    definitely lost: 944 bytes in 1 blocks
      ==16705==    indirectly lost: 8,320 bytes in 4 blocks
      ==16705==      possibly lost: 172,711 bytes in 95 blocks
      ==16705==    still reachable: 1,172,125 bytes in 709 blocks
      ==16705==         suppressed: 0 bytes in 0 blocks
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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