Menu

1.1.0 -> 1.1.6 different behaviour?

Help
2004-10-29
2012-09-19
  • Andre Nathan

    Andre Nathan - 2004-10-29

    Hello

    I'm running the simple script below:

    import MySQLdb
    db = MySQLdb.connect(user="foo", passwd="pass", db="test")
    cur.execute('insert into foo set bar=10')

    This works fine on 1.1.0, but with 1.16 I need to add

    db.commit()

    Else, it won't execute the insert command. Is this behaviour change expected?

    I'm using python-2.3.4 and MySQL 4.0.20.

    Thanks in advance,
    Andre

     
    • Andy Dustman

      Andy Dustman - 2004-11-02

      Yes, autocommit is now turned off by default, as specified by the DB API standard (PEP-249). You can turn this back on with:

      db.autocommit(True)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.