@@ -54,16 +54,16 @@ def normalize_number(self, value: str, coltype: FractionalType) -> str:
5454
5555 return f"FORMAT({ value } , 'N{ coltype .precision } ')"
5656
57+
5758class Mixin_MD5 (AbstractMixin_MD5 ):
5859 def md5_as_int (self , s : str ) -> str :
5960 # TODO FYI
6061 # I didn't see another way to do this
6162 # keep in mind this also required reducing
6263 # CHECKSUM_HEXDIGITS = 15 -> 14 due to the convert needing an even number of hex digits
6364 # (affects all dbs)
64- return (
65- f"convert(bigint, convert(varbinary, '0x' + RIGHT(CONVERT(NVARCHAR(32), HashBytes('MD5', { s } ), 2), { CHECKSUM_HEXDIGITS } ), 1))"
66- )
65+ return f"convert(bigint, convert(varbinary, '0x' + RIGHT(CONVERT(NVARCHAR(32), HashBytes('MD5', { s } ), 2), { CHECKSUM_HEXDIGITS } ), 1))"
66+
6767
6868class Dialect (BaseDialect , Mixin_Schema , Mixin_OptimizerHints ):
6969 name = "MsSQL"
@@ -139,11 +139,11 @@ def random(self) -> str:
139139 def is_distinct_from (self , a : str , b : str ) -> str :
140140 # IS (NOT) DISTINCT FROM is available only since SQLServer 2022.
141141 # See: https://stackoverflow.com/a/18684859/857383
142- return (
143- f"(({ a } <>{ b } OR { a } IS NULL OR { b } IS NULL) AND NOT({ a } IS NULL AND { b } IS NULL))"
144- )
142+ return f"(({ a } <>{ b } OR { a } IS NULL OR { b } IS NULL) AND NOT({ a } IS NULL AND { b } IS NULL))"
145143
146- def offset_limit (self , offset : Optional [int ] = None , limit : Optional [int ] = None , has_order_by : Optional [bool ] = None ) -> str :
144+ def offset_limit (
145+ self , offset : Optional [int ] = None , limit : Optional [int ] = None , has_order_by : Optional [bool ] = None
146+ ) -> str :
147147 if offset :
148148 raise NotImplementedError ("No support for OFFSET in query" )
149149
0 commit comments