IWA doesn't works properly with LIKE sentences
Posted in 2012
Topics: Data Types & Schema Design
I've found a possible bug working with IWA and LIKE sentences.
This is my test case:
CREATE TABLE a_iwa0(
code varchar(10),
val decimal(14,2)
);
INSERT INTO a_iwa0 VALUES('01',1);
INSERT INTO a_iwa0 VALUES('010',2);
INSERT INTO a_iwa0 VALUES('110',4);
set environment use_dwa '1';SELECT SUM(val),
SUM(CASE WHEN code LIKE '0%' THEN val ELSE 0 END),
SUM(CASE WHEN code LIKE '0_' THEN val ELSE 0 END),
SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
FROM a_iwa0;
set environment use_dwa '0';SELECT SUM(val),
SUM(CASE WHEN code LIKE '0%' THEN val ELSE 0 END),
SUM(CASE WHEN code LIKE '0_' THEN val ELSE 0 END),
SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
FROM a_iwa0;
Using IWA the results are:
(sum) (sum) (sum) (sum)
7,00 3,00 3,00 1,00
Third column is bad calculated because should be 1
Without IWA, Sentence works properlly:
(sum) (sum) (sum) (sum)
7,00 3,00 1,00 1,00
Somebody has experience with this kind of problems?
Should this be considered a bug? (I think so!!)
We are evaluatting IWA so we need info about procedure to report this kind of
problems.
If wome Informix Engineers wants more info, don't hesitate to contact me.
Hi Vincente,
On Thursday 31 May 2012 12:51:16 VICENTE SALVADOR wrote:
> I've found a possible bug working with IWA and LIKE sentences.
>
> This is my test case:
>
> CREATE TABLE a_iwa0(
> code varchar(10),
> val decimal(14,2)
> );>
> INSERT INTO a_iwa0 VALUES('01',1);
> INSERT INTO a_iwa0 VALUES('010',2);
> INSERT INTO a_iwa0 VALUES('110',4);>
> set environment use_dwa '1';> SELECT SUM(val),
>
> SUM(CASE WHEN code LIKE '0%' THEN val ELSE 0 END),
>
> SUM(CASE WHEN code LIKE '0_' THEN val ELSE 0 END),
>
> SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
> FROM a_iwa0;
> set environment use_dwa '0';> SELECT SUM(val),
>
> SUM(CASE WHEN code LIKE '0%' THEN val ELSE 0 END),
>
> SUM(CASE WHEN code LIKE '0_' THEN val ELSE 0 END),
>
> SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
> FROM a_iwa0;
>
> Using IWA the results are:
>
> (sum) (sum) (sum) (sum)
>
> 7,00 3,00 3,00 1,00
>
> Third column is bad calculated because should be 1
>
> Without IWA, Sentence works properlly:
>
> (sum) (sum) (sum) (sum)
>
> 7,00 3,00 1,00 1,00
>
> Somebody has experience with this kind of problems?
> Should this be considered a bug? (I think so!!)
We can reproduce this behavior and its a bug. Thanks for reporting!
>
> We are evaluatting IWA so we need info about procedure to report this kind
> of problems.
No problem, I will enter a defect. Please let me know the version of the
product (output of comand "ondwa -version").
Thanks,
Andreas
> If wome Informix Engineers wants more info, don't hesitate to contact me.
>
>
> ***************************************************************************
> **** Forum Note: Use "Reply" to post a response in the discussion forum.
--
Andreas Breitfeld; Informix Development Munich
IBM Deutschland Research & Development GmbH; Vorsitzende des Aufsichtsrats:
Martina Koederitz; Geschaeftsfuehrung: Dirk Wittkopp; Sitz der Gesellschaft:
Boeblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
If you are doing an evaluation you have full IBM support so you can call
the IBM support line and report the bug.
It might to useful to see if the MATCHES version of that query is working
correctly as well:
SELECT SUM(val),
SUM(CASE WHEN code MATCHES '0*' THEN val ELSE 0 END),
SUM(CASE WHEN code MATCHES '0?' THEN val ELSE 0 END),
SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
FROM a_iwa0;
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.
On Thu, May 31, 2012 at 6:51 AM, VICENTE SALVADOR <vsalvador@deister.es>wrote:
> I've found a possible bug working with IWA and LIKE sentences.
>
> This is my test case:
>
> CREATE TABLE a_iwa0(
> code varchar(10),
> val decimal(14,2)
> );>
> INSERT INTO a_iwa0 VALUES('01',1);
> INSERT INTO a_iwa0 VALUES('010',2);
> INSERT INTO a_iwa0 VALUES('110',4);>
> set environment use_dwa '1';> SELECT SUM(val),
>
> SUM(CASE WHEN code LIKE '0%' THEN val ELSE 0 END),
>
> SUM(CASE WHEN code LIKE '0_' THEN val ELSE 0 END),
>
> SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
> FROM a_iwa0;
> set environment use_dwa '0';> SELECT SUM(val),
>
> SUM(CASE WHEN code LIKE '0%' THEN val ELSE 0 END),
>
> SUM(CASE WHEN code LIKE '0_' THEN val ELSE 0 END),
>
> SUM(CASE WHEN LENGTH(code) = 2 THEN val ELSE 0 END)
> FROM a_iwa0;
>
> Using IWA the results are:
>
> (sum) (sum) (sum) (sum)
>
> 7,00 3,00 3,00 1,00
>
> Third column is bad calculated because should be 1
>
> Without IWA, Sentence works properlly:
>
> (sum) (sum) (sum) (sum)
>
> 7,00 3,00 1,00 1,00
>
> Somebody has experience with this kind of problems?
> Should this be considered a bug? (I think so!!)
>
> We are evaluatting IWA so we need info about procedure to report this kind
> of
> problems.
> If wome Informix Engineers wants more info, don't hesitate to contact me.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--14dae93406bb47cd4204c154431b