You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:17:08 UTC
[jira] [Created] (TRAFODION-481) LP Bug: 1349965 - Warning 8402
(string overflow) and incorrect result in sqlci when using input parameter
Alice Chen created TRAFODION-481:
------------------------------------
Summary: LP Bug: 1349965 - Warning 8402 (string overflow) and incorrect result in sqlci when using input parameter
Key: TRAFODION-481
URL: https://issues.apache.org/jira/browse/TRAFODION-481
Project: Apache Trafodion
Issue Type: Bug
Components: sql-cmp
Reporter: Hans Zeller
Assignee: Hans Zeller
Brian Vickery reported this problem:
create table TESTT1
(
DATA1 CHAR(12) not null,
DATA2 CHAR(15) not null,
DATA3 CHAR(2) DEFAULT NULL
)
;
insert into TESTT1 values
('123456789012', 'abcdefghijklmno', '00');
-- from mxci
prepare s from select * from TESTT1 where DATA1 =?a ;
set param ?a '1234567890123';
execute s;
*** WARNING[8402] A string overflow occurred during the evaluation of a character expression.
DATA1 DATA2 DATA3
------------ --------------- -----
123456789012 abcdefghijklmno 00 <<<<<< a row is returned
What happens is that we give the parameter a data type of CHAR(12). This can be seen with a DESCRIBE statement:
describe s;
What we probably should be doing is to use the CQD VARCHAR_PARAM_DEFAULT_SIZE to bump up the string length of the parameter to a higher value, so that it's not restricted to the length of the constant in the query. We do this in one overloaded method of ValueId::coerceType() but not in the other overloaded method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)