The FB reflection code does not raise the appropriate error when the
table does not exist. This is checked by a test, that clearly fails.
The attached patch cures the problem.
ciao, lele.
Fri Oct 6 23:09:17 CEST 2006 [EMAIL PROTECTED]
* Firebird reflection wasn't raising the proper NoSuchTableError
diff -rN -u old-sqlalchemy-firebird/lib/sqlalchemy/databases/firebird.py new-sqlalchemy-firebird/lib/sqlalchemy/databases/firebird.py
--- old-sqlalchemy-firebird/lib/sqlalchemy/databases/firebird.py 2006-10-06 23:14:20.000000000 +0200
+++ new-sqlalchemy-firebird/lib/sqlalchemy/databases/firebird.py 2006-10-06 23:14:20.000000000 +0200
@@ -243,9 +243,11 @@
return name
c = connection.execute(tblqry, [table.name.upper()])
- while True:
- row = c.fetchone()
- if not row: break
+ row = c.fetchone()
+ if not row:
+ raise exceptions.NoSuchTableError(table.name)
+
+ while row:
name = row['FNAME']
args = [lower_if_possible(name)]
@@ -257,6 +259,7 @@
kw['primary_key'] = name in pkfields
table.append_item(schema.Column(*args, **kw))
+ row = c.fetchone()
# get the foreign keys
c = connection.execute(fkqry, ["FOREIGN KEY", table.name.upper()])
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users