Informix - Problem description
Problem IT28341 | Status: Closed |
ODD BEHAVIOUR WHEN USING CONCAT IN CASE STATEMENT IN SPL | |
product: | |
INFORMIX SERVER / 5725A3900 / C10 - IDS 12.10 | |
Problem description: | |
If concat two variables, said v1 varchar(128) , v2 varchar(128), into v3 varchar(255) in case statement, v3 will contains spaces at the end. But if outside case statement, v3 won't contain spaces at the end. set lock mode to wait; create temp table test_varchar_wf_1 (t varchar(127),dtm datetime year to fraction(3), t_result varchar(255)) with no log; create temp table test_varchar_wf_2 (t varchar(128),dtm datetime year to fraction(3), t_result varchar(255)) with no log; drop procedure sp_space_poc_wf; create procedure sp_space_poc_wf() define v_item1_a varchar(127); define v_item1_b varchar(127); define v_item2_a varchar(128); define v_item2_b varchar(128); define v_test1_1 varchar(255); define v_test1_2 varchar(255); define v_test2_1 varchar(255); define v_test2_2 varchar(255); let v_item1_a = "A"; let v_item1_b = "B"; let v_item2_a = "A"; let v_item2_b = "B"; let v_test1_1 = case when 1=1 then v_item1_a || v_item1_b else '' end; let v_test1_2 = v_item1_a || v_item1_b; let v_test2_1 = case when 1=1 then v_item2_a || v_item2_b else '' end; let v_test2_2 = v_item2_a || v_item2_b; insert into test_varchar_wf_1(t, dtm, t_result) values ('v_test1_1', current, v_test1_1); insert into test_varchar_wf_1(t, dtm, t_result) values ('v_test1_2', current, v_test1_2); insert into test_varchar_wf_2(t, dtm, t_result) values ('v_test2_1', current, v_test2_1); insert into test_varchar_wf_2(t, dtm, t_result) values ('v_test2_2', current, v_test2_2); end procedure; execute procedure sp_space_poc_wf(); select t,dtm,t_result,len(t_result) len_t_result ,t_result||'A' t_result_A,len(t_result||'A') len_t_result_A from test_varchar_wf_1; select t,dtm,t_result,len(t_result) len_t_result ,t_result||'A' t_result_A,len(t_result||'A') len_t_result_A from test_varchar_wf_2; t        v_test1_1 dtm       2019-01-11 21:37:05.000 t_result     AB len_t_result   2 t_result_a    ABA len_t_result_a  3 t        v_test1_2 dtm       2019-01-11 21:37:05.000 t_result     AB len_t_result   2 t_result_a    ABA len_t_result_a  3 2 row(s) retrieved. t        v_test2_1 dtm       2019-01-11 21:37:05.000 t_result     AB len_t_result   2 t_result_a    AB                                                                                                                                                                 A len_t_result_a  256 t        v_test2_2 dtm       2019-01-11 21:37:05.000 t_result     AB len_t_result   2 t_result_a    ABA len_t_result_a  3 2 row(s) retrieved. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Users of IDS prior to 12.10.xC13. * **************************************************************** * PROBLEM DESCRIPTION: * * If concat two variables, say v1 varchar(128), v2 * * varchar(128), into v3 varchar(255) in case statement, v3 * * will contain spaces at the end. But if done outside case * * statement, v3 won't contain spaces at the end. * **************************************************************** * RECOMMENDATION: * **************************************************************** | |
Local Fix: | |
Solution | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 06.03.2019 24.09.2019 24.09.2019 |
Problem solved at the following versions (IBM BugInfos) | |
12.10.xC13 | |
Problem solved according to the fixlist(s) of the following version(s) |