This repository was archived by the owner on May 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1313)
1414from data_diff .abcs .database_types import (
1515 JSON ,
16- ColType_UUID ,
1716 NumericType ,
1817 Timestamp ,
1918 TimestampTZ ,
@@ -120,13 +119,15 @@ def limit_select(
120119 ) -> str :
121120 if offset :
122121 raise NotImplementedError ("No support for OFFSET in query" )
123-
124122 result = ""
125123 if not has_order_by :
126124 result += "ORDER BY 1"
127125
128126 result += f" OFFSET 0 ROWS FETCH NEXT { limit } ROWS ONLY"
129- return f"SELECT * FROM ({ select_query } ) AS LIMITED_SELECT { result } "
127+
128+ # mssql requires that subquery columns are all aliased, so
129+ # don't wrap in an outer select
130+ return f"{ select_query } { result } "
130131
131132 def constant_values (self , rows ) -> str :
132133 values = ", " .join ("(%s)" % ", " .join (self ._constant_value (v ) for v in row ) for row in rows )
@@ -155,9 +156,6 @@ def md5_as_int(self, s: str) -> str:
155156 def md5_as_hex (self , s : str ) -> str :
156157 return f"HashBytes('MD5', { s } )"
157158
158- def normalize_uuid (self , value : str , coltype : ColType_UUID ) -> str :
159- return f"TRIM(CAST({ value } AS char)) AS { value } "
160-
161159
162160@attrs .define (frozen = False , init = False , kw_only = True )
163161class MsSQL (ThreadedDatabase ):
You can’t perform that action at this time.
0 commit comments