1
0
Fork 0

Adding upstream version 25.24.5.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:55:31 +01:00
parent a0663ae805
commit 7af32ea9ec
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
80 changed files with 61531 additions and 59444 deletions

View file

@ -8,6 +8,11 @@ class TestTSQL(Validator):
dialect = "tsql"
def test_tsql(self):
self.validate_identity(
"with x as (select 1) select * from x union select * from x order by 1 limit 0",
"WITH x AS (SELECT 1 AS [1]) SELECT TOP 0 * FROM (SELECT * FROM x UNION SELECT * FROM x) AS _l_0 ORDER BY 1",
)
# https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms187879(v=sql.105)?redirectedfrom=MSDN
# tsql allows .. which means use the default schema
self.validate_identity("SELECT * FROM a..b")
@ -46,6 +51,10 @@ class TestTSQL(Validator):
self.validate_identity(
"COPY INTO test_1 FROM 'path' WITH (FORMAT_NAME = test, FILE_TYPE = 'CSV', CREDENTIAL = (IDENTITY='Shared Access Signature', SECRET='token'), FIELDTERMINATOR = ';', ROWTERMINATOR = '0X0A', ENCODING = 'UTF8', DATEFORMAT = 'ymd', MAXERRORS = 10, ERRORFILE = 'errorsfolder', IDENTITY_INSERT = 'ON')"
)
self.validate_identity(
'SELECT 1 AS "[x]"',
"SELECT 1 AS [[x]]]",
)
self.assertEqual(
annotate_types(self.validate_identity("SELECT 1 WHERE EXISTS(SELECT 1)")).sql("tsql"),
"SELECT 1 WHERE EXISTS(SELECT 1)",