This repository was archived by the owner on Jun 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414>>invoke t001t1;
1515
1616-- Definition of Trafodion table TRAFODION.SCH.T001T1
17- -- Definition current Mon Aug 27 15:59:38 2018
17+ -- Definition current Fri Nov 16 17:12:39 2018
1818
1919 (
2020 SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
3232>>invoke $$TEST_SCHEMA$$.t001ut1;
3333
3434-- Definition of Trafodion table TRAFODION.SCH.T001UT1
35- -- Definition current Mon Aug 27 15:59:39 2018
35+ -- Definition current Fri Nov 16 17:12:40 2018
3636
3737 (
3838 SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
445445 .0
446446
447447--- 1 row(s) selected.
448- >>cqd pcode_opt_level 'on';
448+ >>
449+ >>select case when cast(null as int) > 0 and 2>1 then 1/0 else 0 end from dual;
449450
450- --- SQL operation complete.
451+ (EXPR)
452+ -------
453+
454+ .0
455+
456+ --- 1 row(s) selected.
457+ >>select case when cast(null as int) > 0 or 2>1 then 1/0 else 0 end from dual;
458+
459+ *** ERROR[8419] An arithmetic expression attempted a division by zero.
460+
461+ --- 0 row(s) selected.
462+ >>
463+ >>select case when cast(null as int) > 0 and 2>3 then 1/0 else 0 end from dual;
464+
465+ (EXPR)
466+ -------
467+
468+ .0
469+
470+ --- 1 row(s) selected.
471+ >>select case when cast(null as int) > 0 or 2>3 then 1/0 else 0 end from dual;
472+
473+ (EXPR)
474+ -------
475+
476+ .0
477+
478+ --- 1 row(s) selected.
451479>>
452480>>-- PCODE way
481+ >>cqd pcode_opt_level 'on';
482+
483+ --- SQL operation complete.
453484>>select case when cast(null as int) > 0 then 1/0 else 0 end from dual;
454485
486+ (EXPR)
487+ -------
488+
489+ .0
490+
491+ --- 1 row(s) selected.
492+ >>
493+ >>select case when cast(null as int) > 0 and 2>1 then 1/0 else 0 end from dual;
494+
495+ (EXPR)
496+ -------
497+
498+ .0
499+
500+ --- 1 row(s) selected.
501+ >>select case when cast(null as int) > 0 or 2>1 then 1/0 else 0 end from dual;
502+
503+ *** ERROR[8419] An arithmetic expression attempted a division by zero.
504+
505+ --- 0 row(s) selected.
506+ >>
507+ >>select case when cast(null as int) > 0 and 2>3 then 1/0 else 0 end from dual;
508+
509+ (EXPR)
510+ -------
511+
512+ .0
513+
514+ --- 1 row(s) selected.
515+ >>select case when cast(null as int) > 0 or 2>3 then 1/0 else 0 end from dual;
516+
455517(EXPR)
456518-------
457519
Original file line number Diff line number Diff line change @@ -131,11 +131,23 @@ select (case a when 1 then 1 when 2 then 2 else null end) from t001t1; -- ok
131131-- clause way
132132cqd pcode_opt_level 'off';
133133select case when cast(null as int) > 0 then 1/0 else 0 end from dual;
134- cqd pcode_opt_level 'on';
134+
135+ select case when cast(null as int) > 0 and 2>1 then 1/0 else 0 end from dual;
136+ select case when cast(null as int) > 0 or 2>1 then 1/0 else 0 end from dual;
137+
138+ select case when cast(null as int) > 0 and 2>3 then 1/0 else 0 end from dual;
139+ select case when cast(null as int) > 0 or 2>3 then 1/0 else 0 end from dual;
135140
136141-- PCODE way
142+ cqd pcode_opt_level 'on';
137143select case when cast(null as int) > 0 then 1/0 else 0 end from dual;
138144
145+ select case when cast(null as int) > 0 and 2>1 then 1/0 else 0 end from dual;
146+ select case when cast(null as int) > 0 or 2>1 then 1/0 else 0 end from dual;
147+
148+ select case when cast(null as int) > 0 and 2>3 then 1/0 else 0 end from dual;
149+ select case when cast(null as int) > 0 or 2>3 then 1/0 else 0 end from dual;
150+
139151select a from t001t1 where null is null; -- ok
140152select a from t001t1 where null is not null; -- ok (0 rows)
141153
You can’t perform that action at this time.
0 commit comments