thats weird. what versions of sqlite/pysqlite are you running ? On Jul 8, 2006, at 1:32 AM, Jonathan Ellis wrote:
> I'm starting to think there are real problems on windows with sqlite. > > I fixed one that caused a test failure in proxy_engine; patch is > attached. > > But I haven't been able to figure out this other one from > cascade.py . What is happening is that after the first test (the > last test in the code, but the first in unittest) runs, and its > tearDownAll method runs metadata.drop_all(), the engine thinks the > users and prefs tables still exist. So when create_all gets run > for the other set of tests, we have a problem, b/c both tests have > a table called users. So create_all says "oh, you already exist, I > can skip you." But it really doesn't exist; the insert fails. > (Also, issuing a 2nd, identical drop command throws a table-does- > not-exist exception.) > > I tried to duplicate this ghost table effect outside of SA and > failed. But here is a shorter SA script that demonstrates the > problem: > > from sqlalchemy import * > > db = create_engine('sqlite:///:memory:') > md = BoundMetaData(db) > > users = Table('users', md, > Column('id', Integer, Sequence('user_id_seq', optional=True), > primary_key = True), > Column('name', String(40)), > ) > > md.create_all() > md.drop_all () > md.drop_all() > > Traceback (most recent call last): > File "test3.py", line 13, in ? > md.drop_all() > File "./lib/sqlalchemy\schema.py", line 663, in drop_all > engine.run_callable (do) > File "./lib/sqlalchemy\engine\base.py", line 452, in run_callable > return callable_(conn, *args, **kwargs) > File "./lib/sqlalchemy\schema.py", line 662, in do > conn.drop(table) > File "./lib/sqlalchemy\engine\base.py", line 297, in drop > return self.__engine.drop(entity, connection=self, **kwargs) > File "./lib/sqlalchemy\engine\base.py", line 398, in drop > self._run_visitor( self.dialect.schemadropper, entity, > connection=connection, **kwargs) > File "./lib/sqlalchemy\engine\base.py", line 419, in _run_visitor > element.accept_schema_visitor(visitorcallable(self, conn.proxy, > **kwargs)) > File "./lib/sqlalchemy\schema.py", line 191, in > accept_schema_visitor > return visitor.visit_table(self) > File "./lib/sqlalchemy\ansisql.py", line 678, in visit_table > self.execute () > File "./lib/sqlalchemy\engine\base.py", line 681, in execute > return self.proxy(self.buffer.getvalue(), None) > File "./lib/sqlalchemy\engine\base.py", line 350, in proxy > return self._execute_raw(statement, parameters) > File "./lib/sqlalchemy\engine\base.py", line 315, in _execute_raw > self._execute(cursor, statement, parameters, context=context) > File "./lib/sqlalchemy\engine\base.py", line 334, in _execute > raise exceptions.SQLError(statement, parameters, e) > sqlalchemy.exceptions.SQLError: (OperationalError) no such table: > users '\nDROP TABLE users' () > > <windows1.patch> > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users