- mssql
- the String/Unicode types, and their counterparts VARCHAR/
NVARCHAR, emit "max" as the length when no length is
- specified. This makes it more compatible with Postgresql's
- VARCHAR type which is similarly unbounded when no length
- specified.
+ specified, so that the default length, normally '1'
+ as per SQL server documentation, is instead
+ 'unbounded'. This also occurs for the VARBINARY type.
+ [ticket:1833].
+
+ This behavior makes these types more closely compatible
+ with Postgresql's VARCHAR type which is similarly unbounded
+ when no length is specified.
- mysql
- New DBAPI support for pymysql, a pure Python port
def visit_IMAGE(self, type_):
return "IMAGE"
+ def visit_VARBINARY(self, type_):
+ return self._extend(
+ "VARBINARY",
+ type_,
+ length=type_.length or 'max')
+
def visit_boolean(self, type_):
return self.visit_BIT(type_)
'BINARY(10)'),
(mssql.MSVarBinary, [], {},
- 'VARBINARY'),
+ 'VARBINARY(max)'),
(mssql.MSVarBinary, [10], {},
'VARBINARY(10)'),
- (types.VARBINARY, [], {},
- 'VARBINARY'),
(types.VARBINARY, [10], {},
'VARBINARY(10)'),
+ (types.VARBINARY, [], {},
+ 'VARBINARY(max)'),
(mssql.MSImage, [], {},
'IMAGE'),