-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect result of sql server tinyint #11274
Fix incorrect result of sql server tinyint #11274
Conversation
359a12a
to
fba55aa
Compare
plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/AbstractTestOracleTypeMapping.java
Show resolved
Hide resolved
plugin/trino-sqlserver/src/main/java/io/trino/plugin/sqlserver/SqlServerClient.java
Outdated
Show resolved
Hide resolved
docs need to be updated in |
I found that there are some other type mappings not covered by the SQL Server documentation (e.g. |
fba55aa
to
e73a4eb
Compare
e73a4eb
to
62dfd53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks a lot @tangjiangling.
@tangjiangling CI is failing. You'll also need to adjust |
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
Updated and successfully ran SQL Server PTs locally. |
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: