-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
[FB4] A proposal for fixing #7880 #7882
Open
dmitry-lipetsk
wants to merge
1
commit into
FirebirdSQL:v4.0-release
Choose a base branch
from
dmitry-lipetsk:fb4-fix7880-001
base: v4.0-release
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
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
[FB4] A proposal for fixing #7880 #7882
dmitry-lipetsk
wants to merge
1
commit into
FirebirdSQL:v4.0-release
from
dmitry-lipetsk:fb4-fix7880-001
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
These changes force a server to return correct datatype for CAST(something as array datatype) - array type instead type of element. 1) Test of CAST(arrayColumn as ARRAY) SQL> set sqlda_display on; SQL> SELECT CAST(COL_I4 AS VARCHAR(128)[0:2]) FROM TEST_ARR1; INPUT message field count: 0 OUTPUT message field count: 1 01: sqltype: 540 ARRAY Nullable scale: 0 subtype: 0 len: 8 : name: CAST alias: CAST : table: owner: CAST ================= 111:0 Usage of UDFs with SCALAR_ARRAY-argument. These functions return different information about array: DIM, DTYPE, SUBTYPE, SCALE SQL> -- Bad column type: VARCHAR instead ARRAY SQL> -- FETCH returns incorrect data SQL> SELECT IBP_UDF__GET_ARR_DIM(CAST(COL_I4 AS VARCHAR(128)[0:2])) FROM TEST_ARR1; IBP_UDF__GET_ARR_DIM ==================== 1 SQL> SELECT IBP_UDF__GET_ARR_DESC_DTYPE(CAST(COL_I4 AS VARCHAR(128)[0:2])) FROM TEST_ARR1; IBP_UDF__GET_ARR_DESC_DTYPE =========================== 9 SQL> SELECT IBP_UDF__GET_ARR_DESC_LENGTH(CAST(COL_I4 AS VARCHAR(128)[0:2])) FROM TEST_ARR1; IBP_UDF__GET_ARR_DESC_LENGTH ============================ 4 SQL> SELECT IBP_UDF__ADTYPE__VCH64(CAST(COL_I4 AS VARCHAR(128)[0:2])) FROM TEST_ARR1; IBP_UDF__ADTYPE__VCH64 ====================== 3 SQL> SELECT IBP_UDF__ADTYPE__CH64(CAST(COL_I4 AS VARCHAR(128)[0:2])) FROM TEST_ARR1; IBP_UDF__ADTYPE__CH64 ===================== 1 SQL> -- Bad column type: INTEGER instead ARRAY SQL> -- FETCH returns conversion error from string "#x01#x01#x01#x00#x04# ....." SQL> SELECT IBP_UDF__GET_ARR_DIM(CAST(COL_I4 AS INTEGER[0:2])) FROM TEST_ARR1; IBP_UDF__GET_ARR_DIM ==================== 1 SQL> SELECT IBP_UDF__GET_ARR_DESC_DTYPE(CAST(COL_I4 AS INTEGER[0:2])) FROM TEST_ARR1; IBP_UDF__GET_ARR_DESC_DTYPE =========================== 9 SQL> SELECT IBP_UDF__ADTYPE__VCH64(CAST(COL_I4 AS INTEGER[0:2])) FROM TEST_ARR1; IBP_UDF__ADTYPE__VCH64 ====================== 3 SQL> SELECT IBP_UDF__ADTYPE__CH64(CAST(COL_I4 AS INTEGER[0:2])) FROM TEST_ARR1; IBP_UDF__ADTYPE__CH64 ===================== 1 2) TEST OF CAST(? AS array datatype) SQL> set sqlda_display on; SQL> SELECT CAST(? AS INTEGER[0:2]) FROM RDB$DATABASE; INPUT message field count: 1 01: sqltype: 540 ARRAY Nullable scale: 0 subtype: 0 len: 8 : name: alias: : table: owner: OUTPUT message field count: 1 01: sqltype: 540 ARRAY Nullable scale: 0 subtype: 0 len: 8 : name: CAST alias: CAST : table: owner: CAST ================= Statement failed, SQLSTATE = 07002 Dynamic SQL Error -SQLDA error -No SQLDA for input values provided
dmitry-lipetsk
changed the title
A proposal for fixing #7880
[FB4] A proposal for fixing #7880
Nov 27, 2023
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.
These changes force a server to return correct datatype for CAST(something as array datatype) - array type instead type of element.
Usage of UDFs with SCALAR_ARRAY-argument. These functions return different information about array: DIM, element DTYPE, element LENGTH