Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Cast to unlimited varchars in MS SQL (especially UUDS) #825

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

nolar
Copy link
Contributor

@nolar nolar commented Dec 30, 2023

Otherwise, it fails with something like this in tests:

    sql_code = 'SELECT min(CONVERT(varchar, [col])), max(CONVERT(varchar, [col])) FROM [src_mssql_uniqueidentifier_postgresql_char100_50_rrp16]'
data_diff.databases.base.QueryError: ('42000', '[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Insufficient result space to convert uniqueidentifier value to char. (8170) (SQLExecDirectW)')

That's because it cannot convert a 36-symbol UUID to 30-symbol varchar. MS SQL Server uses the default length of 30 if other length is not specified.

@nolar nolar requested a review from dlawin December 30, 2023 16:24
@nolar nolar force-pushed the fix-varchar-result-space branch from 6b0118b to 79b6c89 Compare December 30, 2023 18:49
@nolar nolar merged commit 0978570 into master Dec 30, 2023
@nolar nolar deleted the fix-varchar-result-space branch December 30, 2023 19:27
@nolar nolar mentioned this pull request Jan 2, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant