-
Notifications
You must be signed in to change notification settings - Fork 82
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
Improve mapping of SQL integer types to C corresponding types #370
Open
mloskot
wants to merge
14
commits into
nanodbc:main
Choose a base branch
from
mloskot:ml/fine-grain-numeric-types-mapping
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve mapping of SQL integer types to C corresponding types #370
mloskot
wants to merge
14
commits into
nanodbc:main
from
mloskot:ml/fine-grain-numeric-types-mapping
Conversation
This file contains 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
mloskot
changed the title
ml/fine grain numeric types mapping
Fine-grained mapping of SQL integer types to C corresponding types
Jan 25, 2023
mloskot
changed the title
Fine-grained mapping of SQL integer types to C corresponding types
Improve mapping of SQL integer types to C corresponding types
Jan 25, 2023
mloskot
added a commit
to Cadcorp/nanodbc
that referenced
this pull request
Jan 25, 2023
Porting nanodbc#370 Fine-grained mapping of SQL integer types to C corresponding types Add reading of missing C data types for integers Distinguish SQL_C_BIT data type for reading Prefer mapping of SQL_C_* types to fixed-width integer types Ensure SQL_C_SHORT and SQL_C_LONG are mapped to fixed-width variant types test: Catch up with improved integer types mapping Refine reading of SQL_C_TINYINT into int8_t instead of int16_t The int16_t may lead to numeric garbage for values at range boundaries. tests: Refine SQLite tests for integer types
mloskot
added a commit
to Cadcorp/nanodbc
that referenced
this pull request
Jan 26, 2023
Porting nanodbc#370 Fine-grained mapping of SQL integer types to C corresponding types Add reading of missing C data types for integers Distinguish SQL_C_BIT data type for reading Prefer mapping of SQL_C_* types to fixed-width integer types Ensure SQL_C_SHORT and SQL_C_LONG are mapped to fixed-width variant types test: Catch up with improved integer types mapping Refine reading of SQL_C_TINYINT into int8_t instead of int16_t The int16_t may lead to numeric garbage for values at range boundaries. tests: Refine SQLite tests for integer types Fix size of output value read for SQL_C_BIT data
mloskot
force-pushed
the
ml/fine-grain-numeric-types-mapping
branch
2 times, most recently
from
February 4, 2023 14:01
e41d33a
to
6b7c309
Compare
lexicalunit
approved these changes
May 30, 2023
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!
mloskot
force-pushed
the
ml/fine-grain-numeric-types-mapping
branch
from
August 2, 2023 20:17
6b7c309
to
11430cf
Compare
break; | ||
case SQL_C_LONG: | ||
case SQL_C_SLONG: | ||
result = *(ensure_pdata<int32_t>(column)); | ||
{ | ||
long d = *(ensure_pdata<int32_t>(column)); |
Check warning
Code scanning / PREfast
The variable 'd' does not change after construction, mark it as const (con.4). Warning
The variable 'd' does not change after construction, mark it as const (con.4).
The int16_t may lead to numeric garbage for values at range boundaries.
Types, especially SQL_TINYINT, can be signed or unsigned which is implementation-specific behaviour. The best bet is to ask column descriptor for column signedness and refine output C type and buffer size.
mloskot
force-pushed
the
ml/fine-grain-numeric-types-mapping
branch
from
August 2, 2023 21:04
11430cf
to
74cf4b5
Compare
mloskot
force-pushed
the
ml/fine-grain-numeric-types-mapping
branch
from
August 2, 2023 21:07
74cf4b5
to
3a86690
Compare
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.
References
Closes #369