sqlite dialect inappropriately strips quotes off of defaults when reflecting

Issue #2189 resolved
Mike Bayer repo owner created an issue

patch:

diff -r d326fe639ba3bb938a1db5c99de94a6ddfc030e5 lib/sqlalchemy/dialects/sqlite/base.py
--- a/lib/sqlalchemy/dialects/sqlite/base.py    Wed Jun 08 17:56:00 2011 -0400
+++ b/lib/sqlalchemy/dialects/sqlite/base.py    Thu Jun 09 18:28:22 2011 -0400
@@ -637,10 +637,9 @@
             row = c.fetchone()
             if row is None:
                 break
-            (name, type_, nullable, default, has_default, primary_key) = (row[1](1), row[2](2).upper(), not row[3](3), row[4](4), row[4](4) is not None, row[5](5))
+            (name, type_, nullable, default, has_default, primary_key) = \
+                    (row[1](1), row[2](2).upper(), not row[3](3), row[4](4), row[4](4) is not None, row[5](5))
             name = re.sub(r'^\"|\"$', '', name)
-            if default:
-                default = re.sub(r"^\'|\'$", '', default)
             match = re.match(r'(\w+)(\(.*?\))?', type_)
             if match:
                 coltype = match.group(1)

Comments (2)

  1. Log in to comment