Fix incorrect result of sql server tinyint#11274
Merged
hashhar merged 3 commits intotrinodb:masterfrom Mar 3, 2022
Merged
Conversation
359a12a to
fba55aa
Compare
hashhar
approved these changes
Mar 2, 2022
plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/AbstractTestOracleTypeMapping.java
Outdated
Show resolved
Hide resolved
plugin/trino-sqlserver/src/main/java/io/trino/plugin/sqlserver/SqlServerClient.java
Outdated
Show resolved
Hide resolved
Member
|
docs need to be updated in |
Member
Author
|
I found that there are some other type mappings not covered by the SQL Server documentation (e.g. |
fba55aa to
e73a4eb
Compare
hashhar
reviewed
Mar 2, 2022
e73a4eb to
62dfd53
Compare
hashhar
approved these changes
Mar 2, 2022
Member
hashhar
left a comment
There was a problem hiding this comment.
LGTM.
Thanks a lot @tangjiangling.
Member
|
@tangjiangling CI is failing. You'll also need to adjust |
Member
Author
|
Got it, I'll take a look. |
In the original implementation, we mapped SQL Server tinyint to Trino TINYINT, but there is a difference in the range they supported: - Trino TINYINT supports a range of [-128, 127] - SQL Server tinyint supports a range of [0, 255] So we can't read or write values in the range [128, 255], so we map SQL Server tinyint to Trino SMALLINT in this commit. Although we are now extending the range of SQL Server tinyint in Trino, we don't have to worry about Trino writing values that are not in the range [0, 255] to SQL Server, because SQL Server already guarantees this for us and this behavior is verified by the `BaseSqlServerTypeMapping#testUnsupportedTinyint` test.
62dfd53 to
95d2e8e
Compare
Member
Author
|
Updated and successfully ran SQL Server PTs locally. |
hashhar
approved these changes
Mar 3, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix the correctness of query results.
SQL Server connector.
Fix incorrect result of SQL Server TINYINT.
Related issues, pull requests, and links
Fixes #11209
Documentation
(x) Sufficient documentation is included in this PR.
Release notes
(x) Release notes entries required with the following suggested text: