Update of /cvsroot/monetdb/MonetDB5/src/modules/kernel
In directory
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30195/MonetDB5/src/modules/kernel
Modified Files:
Tag: MonetDB_5-4
batcalc.mx
Log Message:
fixing bug
[ 1911991 ] BETWEEN returns wrong results
https://sourceforge.net/tracker/index.php?func=detail&aid=1911991&group_id=56967&atid=482468
re-aligned (and hence fixed) property propagation in M5's batcalc.mx
with M4's bat_arith.mx
Index: batcalc.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/batcalc.mx,v
retrieving revision 1.148.2.2
retrieving revision 1.148.2.3
diff -u -d -r1.148.2.2 -r1.148.2.3
--- batcalc.mx 8 Feb 2008 15:24:23 -0000 1.148.2.2
+++ batcalc.mx 19 Mar 2008 17:14:12 -0000 1.148.2.3
@@ -517,18 +517,22 @@
} else {
@:accumCst(@3,@1,@4,@5)@
}
- if (@6 == 2)
+ if (@6 & 1) {
bn->tsorted = BATtordered(b);
-#if @7
- else if (@6 == 3) {
- if (*(@5*)cst >= 0)
- bn->tsorted = BATtordered(b);
- else
+ } else
+ if (@6 & 4) {
+ bn->tsorted = REVERT_SORTED(BATtordered(b));
+ } else
+ if (@6 & 16) {
+#if @7 /* skip this for TYPE_oid */
+ if (*(@5*)cst < 0)
bn->tsorted = REVERT_SORTED(BATtordered(b));
- }
+ else
#endif
- else
+ bn->tsorted = BATtordered(b);
+ } else {
bn->tsorted = 0;
+ }
BATkey(BATmirror(bn),FALSE);
BBPkeepref(*ret = bn->batCacheid);
@@ -551,18 +555,22 @@
} else {
@:accumCstLeft(@3,@1,@4,@5)@
}
- if (@6 == 2)
+ if (@6 & 2) {
bn->tsorted = BATtordered(b);
-#if @7
- else if (@6 == 3) {
- if (*(@4*)cst >= 0)
- bn->tsorted = BATtordered(b);
- else
+ } else
+ if (@6 & 8) {
+ bn->tsorted = REVERT_SORTED(BATtordered(b));
+ } else
+ if (@6 & 32) {
+#if @7 /* skip this for TYPE_oid */
+ if (*(@5*)cst < 0)
bn->tsorted = REVERT_SORTED(BATtordered(b));
- }
+ else
#endif
- else
+ bn->tsorted = BATtordered(b);
+ } else {
bn->tsorted = 0;
+ }
BATkey(BATmirror(bn),FALSE);
BBPkeepref(*ret = bn->batCacheid);
@@ -589,18 +597,22 @@
@:accumCst(@3,@1,@4,@5)@
}
BATsetcount(bn, BATcount(b));
- if (@6 == 2)
+ if (@6 & 1) {
bn->tsorted = BATtordered(b);
-#if @7
- else if (@6 == 3) {
- if (*(@5*)cst >= 0)
- bn->tsorted = BATtordered(b);
- else
+ } else
+ if (@6 & 4) {
+ bn->tsorted = REVERT_SORTED(BATtordered(b));
+ } else
+ if (@6 & 16) {
+#if @7 /* skip this for TYPE_oid */
+ if (*(@5*)cst < 0)
bn->tsorted = REVERT_SORTED(BATtordered(b));
- }
+ else
#endif
- else
+ bn->tsorted = BATtordered(b);
+ } else {
bn->tsorted = 0;
+ }
BATkey(BATmirror(bn),FALSE);
if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ);
@@ -630,18 +642,22 @@
@:accumCstLeft(@3,@1,@4,@5)@
}
BATsetcount(bn, BATcount(b));
- if (@6 == 2)
+ if (@6 & 2) {
bn->tsorted = BATtordered(b);
-#if @7
- else if (@6 == 3) {
- if (*(@5*)cst >= 0)
- bn->tsorted = BATtordered(b);
- else
+ } else
+ if (@6 & 8) {
+ bn->tsorted = REVERT_SORTED(BATtordered(b));
+ } else
+ if (@6 & 32) {
+#if @7 /* skip this for TYPE_oid */
+ if (*(@5*)cst < 0)
bn->tsorted = REVERT_SORTED(BATtordered(b));
- }
+ else
#endif
- else
+ bn->tsorted = BATtordered(b);
+ } else {
bn->tsorted = 0;
+ }
BATkey(BATmirror(bn),FALSE);
if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ);
@@ -683,10 +699,21 @@
@:arithmeticImpl(@1,@2,int,int,int,@3,1)@
@c
-@:arithGrpImpl(/,DIV,0)@
-@:arithGrpImpl(*,MUL,3)@
-@:arithGrpImpl(-,SUB,2)@
-@:arithGrpImpl(+,ADD,2)@
+/*
[EMAIL PROTECTED]: +, -, *, / basic arithmetic operator symbol
[EMAIL PROTECTED]: ADD, SUB, MUL, DIV basic arithmetic operator name
[EMAIL PROTECTED]: (bit pattern) disable/enable sorting propagation
+ 1 propagate as-is on bat,const
+ 2 propagate as-is on const,bat
+ 4 propagate reverted on bat,const (not
required/used!)
+ 8 propagate reverted on const,bat
+ 16 propagate as-is / reverted on bat,const if const
>=0 / <0
+ 32 propagate as-is / reverted on const,bat if const
>=0 / <0
+*/
+@:arithGrpImpl(/,DIV,16)@
+@:arithGrpImpl(*,MUL,(16|32))@
+@:arithGrpImpl(-,SUB,(1|8))@
+@:arithGrpImpl(+,ADD,(1|2))@
@- Modulo arithmetic
The Modulo function doesn;t work on all types. Therefore we
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins