-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
String truncation reading 8859-1 Spanish column using isc_dsql_fetch with UTF-8 connection.. [CORE2361] #2784
Comments
Commented by: Richard Wesley (hawkfish) Sorry, it is the isc_dsql_execute call that fails (we have seen both with this expression). |
Commented by: Richard Wesley (hawkfish) Also happens in 2.1.2. |
Modified by: Richard Wesley (hawkfish)Version: 2.1.2 [ 10270 ] |
Modified by: @dyemanovassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Commented by: @asfernandes Simple test case: |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5 RC1 [ 10300 ] |
Commented by: @pcisar QA test added. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: Done successfully Test Details: See also other tickets related to collation ES_ES_CI_AI: CORE1384, CORE1774, CORE1172, CORE1178 |
Submitted by: Richard Wesley (hawkfish)
Jira_subtask_outward CORE2435
Is related to QA393
Database script:
create database "setup.B21839.fdb";
create table "'Master by Reseller$'" (
"Tier" VARCHAR(20) CHARACTER SET ISO8859_1 COLLATE ES_ES_CI_AI
);
commit;
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('(blank)');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('Approved');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('Bronze');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('DMR');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('Domestic Distributor');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('End-User');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('Evaluation');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('Gold');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('New');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('Silver');
insert into "'Master by Reseller$'" ( "Tier" ) VALUES ('VAM');
commit;
We then connect to it using the API:
and attempt to run the following query:
SELECT DISTINCT ((CASE WHEN "'Master by Reseller$'"."Tier" IN ( '(blank)', 'Domestic Distributor', 'End-User', 'Evaluation', 'New') THEN '(blank)' ELSE "'Master by Reseller$'"."Tier" END)) AS "Tier (group)"
FROM "'Master by Reseller$'"
ORDER BY 1 ASC
The XSQLDA structure comes back from isc_dsql_describe with a single record having a length of 0x01c. We multiply this by 4 to make sure we allocate enough space. for the returning string. We then call isc_dsql_execute and isc_dsql_fetch. The isc_dsql_fetch call fails with:
Status: 335544321
arithmetic exception, numeric overflow, or string truncation
Adding the string 'Approved' to the IN list in the query seems to solve the problem. Most notably, it reduces the maximum length of the return string to be less than '(blank)'.
The problem does not reproduce with the UTF8 character set.
Commits: 5350f53 502f0f9
====== Test Details ======
See also other tickets related to collation ES_ES_CI_AI: CORE1384, CORE1774, CORE1172, CORE1178
The text was updated successfully, but these errors were encountered: