Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6757

autocommit does not work in MySQLdb Python connector with MariaDB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.37
    • Fix Version/s: N/A
    • Component/s: Platform Power
    • Labels:
      None
    • Environment:
      Hardware architecture: x86
      Operating system: Red Hat 7.0 GA
      MySQL Python connector version: 1.2.3

      Description

      If i run the following command in Python command line:

      import MySQLdb
      connArgs={"host": <server_url>,
                         "user": <user>,
                         "passwd": <password>,
                         "db": <database_name>}
      conn = MySQLdb.connect(**connArgs)
      conn.autocommit = True
      cursor = conn.cursor(MySQLdb.cursors.DictCursor)
      query = <insert_sql_query>
      cursor.execute(query)

      and then check the MariaDB database, the inserted tuple does not show up in a SELECT query output. If I commit as shown below, the new tuple shows up in SELECT query output.

      conn.commit()

      This works correctly in MySQL server 5.1.66, same MySQLdb module version.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            alanoe Alan Evangelista
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: