Bug in firebird.FBDialect.reflecttable()

Issue #1119 resolved
Former user created an issue

A reflection of my database fails in reflecttable() at {{{row'fdefault'.startswith('DEFAULT ')}}} because the value is "Default 0", not "DEFAULT 0". The small patch fixes the assertion and increases debugging.

Index: sqlalchemy/databases/firebird.py
===================================================================
--- sqlalchemy/databases/firebird.py    (Revision 9509)
+++ sqlalchemy/databases/firebird.py    (Arbeitskopie)
@@ -537,7 +537,7 @@
             # does it have a default value?
             if row['fdefault']('fdefault') is not None:
                 # the value comes down as "DEFAULT 'value'"
-                assert row['fdefault']('fdefault').startswith('DEFAULT ')
+                assert row['fdefault']('fdefault').upper().startswith('DEFAULT '), row
                 defvalue = row['fdefault']('fdefault')[8:](8:)
                 args.append(schema.DefaultClause(sql.text(defvalue)))

Comments (2)

  1. Log in to comment