Changeset: 2dda11d2eb24 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2dda11d2eb24
Removed Files:
        monetdb5/modules/atoms/identifier.h
        monetdb5/modules/atoms/inet.h
Modified Files:
        gdk/gdk_join.c
        gdk/gdk_select.c
        monetdb5/modules/atoms/Makefile.ag
        monetdb5/modules/atoms/identifier.c
        monetdb5/modules/atoms/inet.c
        monetdb5/modules/kernel/bat5.c
        sql/backends/monet5/sql.c
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/dump.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 575 to 300 lines):

diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2372,8 +2372,7 @@ BATsubthetajoin(BAT **r1p, BAT **r2p, BA
        if (joinparamcheck(l, r, NULL, sl, sr, "BATsubthetajoin") == GDK_FAIL)
                return GDK_FAIL;
        if (joininitresults(&r1, &r2,
-                           estimate != BUN_NONE ? estimate :
-                           (sl ? BATcount(sl) : BATcount(l)) * (sr ? 
BATcount(sr) : BATcount(r)),
+                           estimate != BUN_NONE ? estimate : sl ? BATcount(sl) 
: BATcount(l),
                            "BATsubthetajoin") == GDK_FAIL)
                return GDK_FAIL;
        *r1p = r1;
@@ -2479,8 +2478,7 @@ BATsubbandjoin(BAT **r1p, BAT **r2p, BAT
        if (joinparamcheck(l, r, NULL, sl, sr, "BATsubbandjoin") == GDK_FAIL)
                return GDK_FAIL;
        if (joininitresults(&r1, &r2,
-                           estimate != BUN_NONE ? estimate :
-                           (sl ? BATcount(sl) : BATcount(l)) * (sr ? 
BATcount(sr) : BATcount(r)),
+                           estimate != BUN_NONE ? estimate : sl ? BATcount(sl) 
: BATcount(l),
                            "BATsubbandjoin") == GDK_FAIL)
                return GDK_FAIL;
        *r1p = r1;
@@ -2500,8 +2498,7 @@ BATsubrangejoin(BAT **r1p, BAT **r2p, BA
        if (joinparamcheck(l, rl, rh, sl, sr, "BATsubrangejoin") == GDK_FAIL)
                return GDK_FAIL;
        if (joininitresults(&r1, &r2,
-                           estimate != BUN_NONE ? estimate :
-                           (sl ? BATcount(sl) : BATcount(l)) * (sr ? 
BATcount(sr) : BATcount(rl)),
+                           estimate != BUN_NONE ? estimate : sl ? BATcount(sl) 
: BATcount(l),
                            "BATsubrangejoin") == GDK_FAIL)
                return GDK_FAIL;
        *r1p = r1;
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -208,15 +208,11 @@ BAT_hashselect(BAT *b, BAT *s, BAT *bn, 
        }
        BATsetcount(bn, cnt);
        bn->tkey = 1;
-       bn->tdense = bn->tsorted = bn->trevsorted = bn->batCount <= 1;
+       GDKqsort(dst, NULL, NULL, BATcount(bn), SIZEOF_OID, 0, TYPE_oid);
+       bn->tsorted = 1;
+       bn->tdense = bn->trevsorted = bn->batCount <= 1;
        if (bn->batCount == 1)
                bn->tseqbase = *dst;
-       /* temporarily set head to nil so that BATorder doesn't materialize */
-       BATseqbase(bn, oid_nil);
-       if (BATorder(BATmirror(bn)) == GDK_FAIL) {
-               BBPreclaim(bn);
-               return NULL;
-       }
        BATseqbase(bn, 0);
        return bn;
 }
diff --git a/monetdb5/modules/atoms/Makefile.ag 
b/monetdb5/modules/atoms/Makefile.ag
--- a/monetdb5/modules/atoms/Makefile.ag
+++ b/monetdb5/modules/atoms/Makefile.ag
@@ -29,8 +29,8 @@ lib_atoms = {
                batxml.c \
                blob.c blob.h \
                color.c color.h \
-               identifier.c identifier.h \
-               inet.c inet.h \
+               identifier.c \
+               inet.c \
                mtime.c mtime.h \
                streams.c streams.h \
                str.c str.h \
diff --git a/monetdb5/modules/atoms/identifier.c 
b/monetdb5/modules/atoms/identifier.c
--- a/monetdb5/modules/atoms/identifier.c
+++ b/monetdb5/modules/atoms/identifier.c
@@ -29,7 +29,26 @@
  *
  */
 #include "monetdb_config.h"
-#include "identifier.h"        /* for the implementation of the functions */
+#include "mal.h"
+#include "mal_exception.h"
+
+typedef str identifier;
+
+#ifdef WIN32
+#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
+#define identifier_export extern __declspec(dllimport)
+#else
+#define identifier_export extern __declspec(dllexport)
+#endif
+#else
+#define identifier_export extern
+#endif
+
+identifier_export int TYPE_identifier;
+identifier_export str IDprelude(void *ret);
+identifier_export int IDfromString(str src, int *len, identifier *retval);
+identifier_export int IDtoString(str *retval, int *len, identifier handle);
+identifier_export str IDentifier(identifier *retval, str *in);
 
 int TYPE_identifier;
 
diff --git a/monetdb5/modules/atoms/identifier.h 
b/monetdb5/modules/atoms/identifier.h
deleted file mode 100644
--- a/monetdb5/modules/atoms/identifier.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The contents of this file are subject to the MonetDB Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.monetdb.org/Legal/MonetDBLicense
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is the MonetDB Database System.
- *
- * The Initial Developer of the Original Code is CWI.
- * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
- * Copyright August 2008-2015 MonetDB B.V.
- * All Rights Reserved.
- */
-
-/*
- * @- Implementation
- */
-#ifndef _IDtype_DEF
-#define _IDtype_DEF
-#include "mal.h"
-#include "mal_exception.h"
-
-typedef str identifier;
-
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
-#define identifier_export extern __declspec(dllimport)
-#else
-#define identifier_export extern __declspec(dllexport)
-#endif
-#else
-#define identifier_export extern
-#endif
-
-identifier_export int TYPE_identifier;
-identifier_export str IDprelude(void *ret);
-identifier_export int IDfromString(str src, int *len, identifier *retval);
-identifier_export int IDtoString(str *retval, int *len, identifier handle);
-identifier_export str IDentifier(identifier *retval, str *in);
-#endif /* _IDTYPE_DEF */
-
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -32,7 +32,68 @@
 #include <gdk.h>
 #include "mal.h"
 #include "mal_exception.h"
-#include "inet.h"
+
+/*
+ * @* Implementation Code
+ * The first 4 bytes of the used lng are in use by the four quads of the
+ * IPv4 address, stored in network order.  In the four bytes left,
+ * additional information is stored.
+ * Currently the fifth byte holds the number of bits from the IPv4 address
+ * that should match (ie. /8, /16, /24, /32) also known as subnet mask.
+ * The last byte holds whether inet atom represents the value nil or not.
+ * The value nil is represented as (per byte) 0000 0001.
+ *
+ */
+typedef struct _inet {
+       unsigned char q1;
+       unsigned char q2;
+       unsigned char q3;
+       unsigned char q4;
+       unsigned char mask;
+       unsigned char filler1;
+       unsigned char filler2;
+       unsigned char isnil;
+} inet;
+#define in_isnil(i) ((i)->q1 == 0 && (i)->q2 == 0 && (i)->q3 == 0 && (i)->q4 
== 0 && (i)->mask == 0 && (i)->isnil != 0)
+#define in_setnil(i) (i)->q1 = (i)->q2 = (i)->q3 = (i)->q4 = (i)->mask = 
(i)->filler1 = (i)->filler2 = 0; (i)->isnil = 1
+
+#ifdef WIN32
+#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
+#define inet_export extern __declspec(dllimport)
+#else
+#define inet_export extern __declspec(dllexport)
+#endif
+#else
+#define inet_export extern
+#endif
+
+inet_export int INETfromString(str src, int *len, inet **retval);
+inet_export int INETtoString(str *retval, int *len, inet *handle);
+inet_export int INETcompare(inet *l, inet *r);
+inet_export str INETnew(inet * retval, str *in);
+inet_export str INET_isnil(bit *retval, inet * val);
+inet_export str INET_comp_EQ(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_NEQ(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_LT(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_GT(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_LE(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_GE(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_CW(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_CWE(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_CS(bit *retval, inet * val1, inet *val2);
+inet_export str INET_comp_CSE(bit *retval, inet * val1, inet *val2);
+inet_export str INETbroadcast(inet * retval, inet *val);
+inet_export str INEThost(str *retval, inet *val);
+inet_export str INETmasklen(int *retval, inet *val);
+inet_export str INETsetmasklen(inet *retval, inet *val, int *mask);
+inet_export str INETnetmask(inet *retval, inet *val);
+inet_export str INEThostmask(inet *retval, inet *val);
+inet_export str INETnetwork(inet *retval, inet *val);
+inet_export str INETtext(str *retval, inet *val);
+inet_export str INETabbrev(str *retval, inet *val);
+inet_export str INET_inet(inet *d, inet *s);
+inet_export str INET_fromstr(inet *ret, str *s);
+inet_export inet *INETnull(void);
 
 static inet inet_nil = {0,0,0,0,0,0,0,1};
 
diff --git a/monetdb5/modules/atoms/inet.h b/monetdb5/modules/atoms/inet.h
deleted file mode 100644
--- a/monetdb5/modules/atoms/inet.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * The contents of this file are subject to the MonetDB Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.monetdb.org/Legal/MonetDBLicense
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is the MonetDB Database System.
- *
- * The Initial Developer of the Original Code is CWI.
- * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
- * Copyright August 2008-2015 MonetDB B.V.
- * All Rights Reserved.
- */
-
-/*
- * @* Implementation Code
- * The first 4 bytes of the used lng are in use by the four quads of the
- * IPv4 address, stored in network order.  In the four bytes left,
- * additional information is stored.
- * Currently the fifth byte holds the number of bits from the IPv4 address
- * that should match (ie. /8, /16, /24, /32) also known as subnet mask.
- * The last byte holds whether inet atom represents the value nil or not.
- * The value nil is represented as (per byte) 0000 0001.
- *
- */
-typedef struct _inet {
-       unsigned char q1;
-       unsigned char q2;
-       unsigned char q3;
-       unsigned char q4;
-       unsigned char mask;
-       unsigned char filler1;
-       unsigned char filler2;
-       unsigned char isnil;
-} inet;
-#define in_isnil(i) ((i)->q1 == 0 && (i)->q2 == 0 && (i)->q3 == 0 && (i)->q4 
== 0 && (i)->mask == 0 && (i)->isnil != 0)
-#define in_setnil(i) (i)->q1 = (i)->q2 = (i)->q3 = (i)->q4 = (i)->mask = 
(i)->filler1 = (i)->filler2 = 0; (i)->isnil = 1
-
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
-#define inet_export extern __declspec(dllimport)
-#else
-#define inet_export extern __declspec(dllexport)
-#endif
-#else
-#define inet_export extern
-#endif
-
-inet_export int INETfromString(str src, int *len, inet **retval);
-inet_export int INETtoString(str *retval, int *len, inet *handle);
-inet_export int INETcompare(inet *l, inet *r);
-inet_export str INETnew(inet * retval, str *in);
-inet_export str INET_isnil(bit *retval, inet * val);
-inet_export str INET_comp_EQ(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_NEQ(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_LT(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_GT(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_LE(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_GE(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CW(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CWE(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CS(bit *retval, inet * val1, inet *val2);
-inet_export str INET_comp_CSE(bit *retval, inet * val1, inet *val2);
-inet_export str INETbroadcast(inet * retval, inet *val);
-inet_export str INEThost(str *retval, inet *val);
-inet_export str INETmasklen(int *retval, inet *val);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to