-
Notifications
You must be signed in to change notification settings - Fork 0
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
Type conversion #14
Type conversion #14
Conversation
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
sql-odbc/src/sqlodbc/info.c
Outdated
#endif /* UNICODE_SUPPORT */ | ||
len = sizeof(SQLUINTEGER); | ||
value = 0; /* CONVERT is unavailable */ | ||
break; | ||
|
||
case SQL_CONVERT_INTEGER: /* ODBC 1.0 */ | ||
len = sizeof(SQLUINTEGER); | ||
value = SQL_CVT_BIT | SQL_CVT_WVARCHAR | SQL_CVT_DOUBLE | SQL_CVT_BIGINT | SQL_CVT_REAL; |
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.
I think you're also missing the ability to convert to the same type, ex integer -> integer, and so on?
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.
Also ,should what about SQL_CVT_VARCHAR in addition to SQL_CVT_WVARCHAR?
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.
Should SQL_CVT_SMALLINT or SQL_CVT_TINYINT also be here? (I'm assuming those are valid constants, it's possible they are not).
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.
I will add conversion for the same types.
SQLGetTypeInfo does not include the value for type SQL_CVT_VARCHAR so I assume it is not supported.
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.
SMALLINT and TINYINT are byte and short for OpenSearch and casting to byte, short, SMALLINT, and TINYINT do not work.
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.
I see SQL_CVT_VARCHAR here: https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function?view=sql-server-ver15 ?
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.
Note that my comment around SMALLINT and TINYINT are for all conversions, are they unsupported for all?
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.
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.
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.
I thinks you need to split changed into two different branches. One branch should contain changes in the driver only and the second one - changes in PBI connector.
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
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.
LGFM.
TEST_SQL_GET_INFO_UINT_MASK(SQLConvertDecimal, SQL_CONVERT_DECIMAL, 0); | ||
TEST_SQL_GET_INFO_UINT_MASK(SQLConvertDouble, SQL_CONVERT_DOUBLE, 0); | ||
// 8409288 = 0x008050C8 = SQL_CVT_INTEGER | SQL_CVT_REAL | SQL_CVT_DOUBLE | SQL_CVT_BIT | SQL_CVT_BIGINT | SQL_CVT_WVARCHAR | ||
TEST_SQL_GET_INFO_UINT_MASK(SQLConvertDouble, SQL_CONVERT_DOUBLE, 8409288); |
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.
Instead of documenting this via a comment, you can simply put the bitmask into the value.
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.
Changed in 284376e
Signed-off-by: Guian Gumpac <[email protected]>
…arch-project#1971) * Spotless apply on protocol Signed-off-by: Mitchell Gale <[email protected]> * added ignorefailures Signed-off-by: Mitchell Gale <[email protected]> * Update protocol/src/main/java/org/opensearch/sql/protocol/response/format/RawResponseFormatter.java Co-authored-by: Yury-Fridlyand <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> * Apply suggestions from code review Co-authored-by: Guian Gumpac <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]> Co-authored-by: Guian Gumpac <[email protected]>
…arch-project#1971) * Spotless apply on protocol Signed-off-by: Mitchell Gale <[email protected]> * added ignorefailures Signed-off-by: Mitchell Gale <[email protected]> * Update protocol/src/main/java/org/opensearch/sql/protocol/response/format/RawResponseFormatter.java Co-authored-by: Yury-Fridlyand <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> * Apply suggestions from code review Co-authored-by: Guian Gumpac <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]> Co-authored-by: Guian Gumpac <[email protected]>
Description
Modified the ODBC Driver to recognize support for conversion of OpenSearch types:
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.