Skip to content

Commit 5c30ab6

Browse files
authored
Merge pull request #305 from microsoft/fix-schema-tests
Fix schema db default test
2 parents 0f4008e + 5f4993a commit 5c30ab6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mssql/introspection.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ def get_table_description(self, cursor, table_name, identity_check=True):
138138
column[1] = SQL_AUTOFIELD
139139
if column[1] == Database.SQL_WVARCHAR and column[3] < 4000:
140140
column[1] = Database.SQL_WCHAR
141+
# Remove surrounding parentheses for default values
142+
if column[7]:
143+
default_value = column[7]
144+
start = 0
145+
end = -1
146+
for _ in range(2):
147+
if default_value[start] == '(' and default_value[end] == ')':
148+
start += 1
149+
end -= 1
150+
column[7] = default_value[start:end + 1]
151+
141152
items.append(FieldInfo(*column))
142153
return items
143154

0 commit comments

Comments
 (0)