
|
If you were logged in you would be able to see more operations.
|
|
|
Time Tracking:
Issue & Sub-Tasks
Issue Only
Issue & Sub-Tasks
Issue Only
|
|
|
|
Environment:
|
Win XP 32 bit
|
|
Issue Links:
|
Relate
|
|
|
|
This issue is related to:
|
|
|
|
|
|
|
|
| Planning Status: |
Unspecified
|
|
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:
dpb.SetParam( isc_dpb_user_name, attr[ DataConnection::attrUsername ] );
dpb.SetParam( isc_dpb_password, pwd );
dpb.SetParam( isc_dpb_lc_ctype, _T("UTF8") );
dpb.SetParam( isc_dpb_sql_dialect, (ISC_SCHAR) SQL_DIALECT_V6 );
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.
|
|
Description
|
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:
dpb.SetParam( isc_dpb_user_name, attr[ DataConnection::attrUsername ] );
dpb.SetParam( isc_dpb_password, pwd );
dpb.SetParam( isc_dpb_lc_ctype, _T("UTF8") );
dpb.SetParam( isc_dpb_sql_dialect, (ISC_SCHAR) SQL_DIALECT_V6 );
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.
|
Show » |
|