[Buildbot-commits] [Buildbot] #1810: older versions of sqlite don't handle DDL changes between connections

Buildbot nobody at buildbot.net
Tue Feb 15 03:03:25 UTC 2011


#1810: older versions of sqlite don't handle DDL changes between connections
-------------------+----------------------
Reporter:  dustin  |      Owner:
    Type:  defect  |     Status:  new
Priority:  major   |  Milestone:  0.8.4
 Version:  master  |   Keywords:  database
-------------------+----------------------
 The following fails on sqlite-3.4.2
 {{{
 import os
 import sqlite3

 if os.path.exists("/tmp/my.db"):
         os.unlink("/tmp/my.db")

 def combined():
         conn1 = sqlite3.connect("/tmp/my.db")
         curs1 = conn1.cursor()
         print "1: pragma" ## B
         curs1.execute("PRAGMA table_info('foo')")

         conn2 = sqlite3.connect("/tmp/my.db")
         curs2 = conn2.cursor()
         print "2: create"
         curs2.execute("CREATE TABLE foo ( a integer )")
         conn2.commit()
         conn2.close() ## C

         print "1: select"
         # curs1.execute("SELECT * from sqlite_master") ## A
         curs1.execute("SELECT * from foo")

 combined()
 }}}
 as follows:
 {{{
 1: pragma
 2: create
 1: select
 Traceback (most recent call last):
   File "simp.py", line 23, in <module>
     combined()
   File "simp.py", line 21, in combined
     curs1.execute("SELECT * from foo")
 sqlite3.OperationalError: no such table: foo
 }}}


 Uncommenting the sqlite_master select (A) will eliminate the
 OperationalError.
 Commenting out the pragma (B) will eliminate the OperationalError.
 Adding {{{conn2.close()}}} after the commit (C) does not help
 (OperationalError stil occurs)

 I haven't managed to find an upstream bug for this yet, bug I'll link it
 here when I do.  For the moment, I'm going to add a nasty, ugly, no-good
 workaround based on B.

-- 
Ticket URL: <http://trac.buildbot.net/ticket/1810>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list