Changeset: 706a25eb9ddd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=706a25eb9ddd
Modified Files:
        clients/Tests/exports.stable.out
        clients/python2/monetdb/control.py
        clients/python2/monetdb/mapi.py
        clients/python2/monetdb/sql/connections.py
        clients/python2/test/run.sh
        clients/python3/monetdb/mapi.py
        clients/python3/test/dbapi20.py
        clients/python3/test/runtests.py
        gdk/gdk.h
        gdk/gdk_aggr.c
        gdk/gdk_bat.c
        gdk/gdk_calc.h
        gdk/gdk_group.c
        gdk/gdk_heap.c
        gdk/gdk_search.c
        gdk/gdk_search.h
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_resource.c
        monetdb5/mal/mal_resource.h
        monetdb5/modules/kernel/aggr.c
        monetdb5/modules/kernel/aggr.mal
        monetdb5/modules/kernel/aggr.mal.sh
        monetdb5/modules/kernel/algebra.mx
        monetdb5/modules/kernel/bat5.c
        monetdb5/modules/kernel/group.mx
        monetdb5/modules/mal/const.c
        monetdb5/optimizer/Tests/tst4631.stable.out
        monetdb5/optimizer/Tests/tst4730.stable.out
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.mx
        sql/include/sql_catalog.h
        sql/server/rel_optimizer.c
        sql/server/rel_select.c
        sql/server/rel_updates.c
        sql/storage/bat/bat_storage.c
        sql/storage/sql_catalog.c
        sql/storage/store.c
        
sql/test/BugTracker-2009/Tests/use_order_column_first.SF-2686008.stable.out
        
sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out
        
sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
        sql/test/BugTracker-2013/Tests/subtract-one-year.Bug-3215.stable.err
        sql/test/BugTracker-2013/Tests/subtract-one-year.Bug-3215.stable.out
        sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
        sql/test/Tests/order_by_complex_exp.stable.out
Branch: rdf
Log Message:

Merge with the default branch


diffs (truncated from 4080 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -121,7 +121,7 @@ int BATgetaccess(BAT *b);
 PROPrec *BATgetprop(BAT *b, int idx);
 gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *g, 
BAT *e, BAT *h);
 const char *BATgroupaggrinit(const BAT *b, const BAT *g, const BAT *e, const 
BAT *s, oid *minp, oid *maxp, BUN *ngrpp, BUN *startp, BUN *endp, BUN *cntp, 
const oid **candp, const oid **candendp);
-BAT *BATgroupavg(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int 
abort_on_error);
+gdk_return BATgroupavg(BAT **bnp, BAT **cntsp, BAT *b, BAT *g, BAT *e, BAT *s, 
int tp, int skip_nils, int abort_on_error);
 BAT *BATgroupcount(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int 
abort_on_error);
 BAT *BATgroupmax(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int 
abort_on_error);
 BAT *BATgroupmedian(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int 
abort_on_error);
@@ -607,8 +607,10 @@ char *mapi_unquote(char *msg);
 MapiMsg mapi_virtual_result(MapiHdl hdl, int columns, const char 
**columnnames, const char **columntypes, const int *columnlengths, int 
tuplecount, const char ***tuples);
 
 # monetdb5
-str AGGRavg2_dbl(bat *retval, bat *bid, bat *eid);
-str AGGRavg3_dbl(bat *retval, bat *bid, bat *gid, bat *eid);
+str AGGRavg12_dbl(bat *retval, bat *bid, bat *eid);
+str AGGRavg13_dbl(bat *retval, bat *bid, bat *gid, bat *eid);
+str AGGRavg22_dbl(bat *retval1, bat *retval2, bat *bid, bat *eid);
+str AGGRavg23_dbl(bat *retval1, bat *retval2, bat *bid, bat *gid, bat *eid);
 str AGGRcount2(bat *retval, bat *bid, bat *eid, bit *ignorenils);
 str AGGRcount2nils(bat *retval, bat *bid, bat *eid);
 str AGGRcount2nonils(bat *retval, bat *bid, bat *eid);
@@ -640,8 +642,10 @@ str AGGRstdev2_dbl(bat *retval, bat *bid
 str AGGRstdev3_dbl(bat *retval, bat *bid, bat *gid, bat *eid);
 str AGGRstdevp2_dbl(bat *retval, bat *bid, bat *eid);
 str AGGRstdevp3_dbl(bat *retval, bat *bid, bat *gid, bat *eid);
-str AGGRsubavg_dbl(bat *retval, bat *bid, bat *gid, bat *eid, bit *skip_nils, 
bit *abort_on_error);
-str AGGRsubavgcand_dbl(bat *retval, bat *bid, bat *gid, bat *eid, bat *sid, 
bit *skip_nils, bit *abort_on_error);
+str AGGRsubavg1_dbl(bat *retval, bat *bid, bat *gid, bat *eid, bit *skip_nils, 
bit *abort_on_error);
+str AGGRsubavg1cand_dbl(bat *retval, bat *bid, bat *gid, bat *eid, bat *sid, 
bit *skip_nils, bit *abort_on_error);
+str AGGRsubavg2_dbl(bat *retval1, bat *retval2, bat *bid, bat *gid, bat *eid, 
bit *skip_nils, bit *abort_on_error);
+str AGGRsubavg2cand_dbl(bat *retval1, bat *retval2, bat *bid, bat *gid, bat 
*eid, bat *sid, bit *skip_nils, bit *abort_on_error);
 str AGGRsubcount(bat *retval, bat *bid, bat *gid, bat *eid, bit *skip_nils);
 str AGGRsubcountcand(bat *retval, bat *bid, bat *gid, bat *eid, bat *sid, bit 
*skip_nils);
 str AGGRsubmax(bat *retval, bat *bid, bat *gid, bat *eid, bit *skip_nils);
diff --git a/clients/python2/monetdb/control.py 
b/clients/python2/monetdb/control.py
--- a/clients/python2/monetdb/control.py
+++ b/clients/python2/monetdb/control.py
@@ -29,7 +29,7 @@ class Control:
     lock, unlock, destroy your databases and request status information.
     """
     def __init__(self, hostname, port, passphrase):
-        self.server = mapi.Server()
+        self.server = mapi.Connection()
         self.server.connect(hostname, port, 'monetdb', passphrase, 
'merovingian', 'control')
 
     def _send_command(self, database_name, command):
@@ -141,4 +141,4 @@ class Control:
         return self.get("#defaults")
 
     def neighbours(self):
-        return self._send_command("anelosimus", "eximius")
\ No newline at end of file
+        return self._send_command("anelosimus", "eximius")
diff --git a/clients/python2/monetdb/mapi.py b/clients/python2/monetdb/mapi.py
--- a/clients/python2/monetdb/mapi.py
+++ b/clients/python2/monetdb/mapi.py
@@ -84,12 +84,7 @@ class Connection(object):
         self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 0)
         self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 
-        try:
-            self.socket.connect((hostname, port))
-        except socket.error, error:
-            (error_code, error_str) = error
-            raise OperationalError(error_str + " (%s:%s)" % (self.hostname, 
self.port))
-
+        self.socket.connect((hostname, port))
         self.__login()
 
 
@@ -232,13 +227,10 @@ class Connection(object):
         result = StringIO()
         count = bytes
         while count > 0:
-            try:
-                recv = self.socket.recv(count)
-                if len(recv) == 0:
-                    time.sleep(1)
-                #logger.debug("II: package size: %i payload: %s" % (len(recv), 
recv))
-            except socket.error, error:
-                raise OperationalError(error[1])
+            recv = self.socket.recv(count)
+            if len(recv) == 0:
+                time.sleep(1)
+            #logger.debug("II: package size: %i payload: %s" % (len(recv), 
recv))
             count -= len(recv)
             result.write(recv)
         return result.getvalue()
@@ -256,11 +248,8 @@ class Connection(object):
             flag = struct.pack( '<H', ( length << 1 ) + last )
             #logger.debug("II: sending %i bytes, last: %s" % (length, 
bool(last)))
             #logger.debug("TX: %s" % data)
-            try:
-                self.socket.send(flag)
-                self.socket.send(data)
-            except socket.error, error:
-                raise OperationalError(error[1])
+            self.socket.send(flag)
+            self.socket.send(data)
             pos += length
 
 
diff --git a/clients/python2/monetdb/sql/connections.py 
b/clients/python2/monetdb/sql/connections.py
--- a/clients/python2/monetdb/sql/connections.py
+++ b/clients/python2/monetdb/sql/connections.py
@@ -44,7 +44,7 @@ class Connection(object):
             username = user
         if host is not None:
             hostname = host
-        self.mapi = mapi.Server()
+        self.mapi = mapi.Connection()
         self.mapi.connect(hostname=hostname, port=int(port), username=username,
             password=password, database=database, language="sql")
         self.set_autocommit(autocommit)
diff --git a/clients/python2/test/run.sh b/clients/python2/test/run.sh
--- a/clients/python2/test/run.sh
+++ b/clients/python2/test/run.sh
@@ -7,4 +7,4 @@ export TSTPASSWORD="monetdb"
 export TSTDEBUG="no"
 
 nosetests ./runtests.py
-nosetests ./test_control.py
\ No newline at end of file
+nosetests ./test_control.py
diff --git a/clients/python3/monetdb/mapi.py b/clients/python3/monetdb/mapi.py
--- a/clients/python3/monetdb/mapi.py
+++ b/clients/python3/monetdb/mapi.py
@@ -265,7 +265,6 @@ class Connection(object):
         if self.socket:
             self.socket.close()
 
-
 #backwards compatiblity
 Server = Connection
 
diff --git a/clients/python3/test/dbapi20.py b/clients/python3/test/dbapi20.py
--- a/clients/python3/test/dbapi20.py
+++ b/clients/python3/test/dbapi20.py
@@ -878,6 +878,7 @@ class DatabaseAPI20Test(unittest.TestCas
         self.assertTrue(hasattr(self.driver,'ROWID'),
             'module.ROWID must be defined.'
             )
+
     def test_utf8(self):
         con = self._connect()
         try:
diff --git a/clients/python3/test/runtests.py b/clients/python3/test/runtests.py
--- a/clients/python3/test/runtests.py
+++ b/clients/python3/test/runtests.py
@@ -94,23 +94,9 @@ if __name__ == '__main__':
     suites = [
         Test_Capabilities,
         Test_DBAPI20,
-    ]
-
-    for suite in suites:
-        tests = unittest.TestLoader().loadTestsFromTestCase(suite)
-        TextTestRunnerNoTime(verbosity=3).run(tests)
-
-
-if __name__ == '__main__':
-    suites = [
-        Test_Capabilities,
-        Test_DBAPI20,
         test_pythonize.TestPythonize,
         ]
 
     for suite in suites:
         tests = unittest.TestLoader().loadTestsFromTestCase(suite)
         TextTestRunnerNoTime(verbosity=3).run(tests)
-
-
-
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -552,6 +552,26 @@ typedef size_t BUN;
 #endif
 #define BUN_MAX (BUN_NONE - 1) /* maximum allowed size of a BAT */
 
+#define BUN1 1
+#define BUN2 2
+#define BUN4 4
+#if SIZEOF_BUN > 4
+#define BUN8 8
+#endif
+typedef uint8_t  BUN1type;
+typedef uint16_t BUN2type;
+typedef uint32_t BUN4type;
+#if SIZEOF_BUN > 4
+typedef uint64_t BUN8type;
+#endif
+#define BUN1_NONE ((BUN1type) 0xFF)
+#define BUN2_NONE ((BUN2type) 0xFFFF)
+#define BUN4_NONE ((BUN4type) 0xFFFFFFFF)
+#if SIZEOF_BUN > 4
+#define BUN8_NONE ((BUN8type) LL_CONSTANT(0xFFFFFFFFFFFFFFFF))
+#endif
+
+
 /*
  * @- Checking and Error definitions:
  */
@@ -634,10 +654,12 @@ typedef struct {
 
 typedef struct {
        int type;               /* type of index entity */
+       int width;              /* width of hash entries */
+       BUN nil;                /* nil representation */
        BUN lim;                /* collision list size */
        BUN mask;               /* number of hash buckets-1 (power of 2) */
-       BUN *hash;              /* hash table */
-       BUN *link;              /* collision list */
+       void *Hash;             /* hash table */
+       void *Link;             /* collision list */
        Heap *heap;             /* heap where the hash is stored */
 } Hash;
 
@@ -2904,19 +2926,19 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b
 #define GDK_STREQ(l,r) (*(char*) (l) == *(char*) (r) && !strcmp(l,r))
 
 #define HASHloop(bi, h, hb, v)                                 \
-       for (hb = (h)->hash[HASHprobe((h), v)];                 \
-            hb != BUN_NONE;                                    \
-            hb = (h)->link[hb])                                \
+       for (hb = HASHget(h, HASHprobe((h), v));                        \
+            hb != HASHnil(h);                                  \
+            hb = HASHgetlink(h,hb))                            \
                if (ATOMcmp(h->type, v, BUNhead(bi, hb)) == 0)
 #define HASHloop_str_hv(bi, h, hb, v)                          \
-       for (hb = (h)->hash[((BUN *) (v))[-1]&(h)->mask];       \
-            hb != BUN_NONE;                                    \
-            hb = (h)->link[hb])                                \
+       for (hb = HASHget((h),((BUN *) (v))[-1]&(h)->mask);     \
+            hb != HASHnil(h);                                  \
+            hb = HASHgetlink(h,hb))                            \
                if (GDK_STREQ(v, BUNhvar(bi, hb)))
 #define HASHloop_str(bi, h, hb, v)                     \
-       for (hb = (h)->hash[strHash(v)&(h)->mask];      \
-            hb != BUN_NONE;                            \
-            hb = (h)->link[hb])                        \
+       for (hb = HASHget((h),strHash(v)&(h)->mask);    \
+            hb != HASHnil(h);                          \
+            hb = HASHgetlink(h,hb))                    \
                if (GDK_STREQ(v, BUNhvar(bi, hb)))
 
 /*
@@ -2927,8 +2949,8 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b
  * numbers instead of strings:
  */
 #define HASHloop_fstr(bi, h, hb, idx, v)                               \
-       for (hb = h->hash[strHash(v)&h->mask], idx = 
strLocate((bi.b)->H->vheap,v); \
-            hb != BUN_NONE; hb = h->link[hb])                          \
+       for (hb = HASHget(h, strHash(v)&h->mask), idx = 
strLocate((bi.b)->H->vheap,v); \
+            hb != HASHnil(h); hb = HASHgetlink(h,hb))                          
\
                if (VarHeapValRaw((bi).b->H->heap.base, hb, (bi).b->H->width) 
== idx)
 /*
  * The following example shows how the hashloop is used:
@@ -2958,20 +2980,20 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b
  * (HASHlooploc) or variable-sized (HASHloopvar).
  */
 #define HASHlooploc(bi, h, hb, v)                              \
-       for (hb = (h)->hash[HASHprobe(h, v)];                   \
-            hb != BUN_NONE;                                    \
-            hb = (h)->link[hb])                                \
+       for (hb = HASHget(h, HASHprobe(h, v));                  \
+            hb != HASHnil(h);                                  \
+            hb = HASHgetlink(h,hb))                            \
                if (ATOMcmp(h->type, v, BUNhloc(bi, hb)) == 0)
 #define HASHloopvar(bi, h, hb, v)                              \
-       for (hb = (h)->hash[HASHprobe(h, v)];                   \
-            hb != BUN_NONE;                                    \
-            hb = (h)->link[hb])                                \
+       for (hb = HASHget(h,HASHprobe(h, v));                   \
+            hb != HASHnil(h);                                  \
+            hb = HASHgetlink(h,hb))                            \
                if (ATOMcmp(h->type, v, BUNhvar(bi, hb)) == 0)
 
 #define HASHloop_TYPE(bi, h, hb, v, TYPE)                      \
-       for (hb = (h)->hash[hash_##TYPE(h, v)];                 \
-            hb != BUN_NONE;                                    \
-            hb = (h)->link[hb])                                \
+       for (hb = HASHget(h, hash_##TYPE(h, v));                        \
+            hb != HASHnil(h);                                  \
+            hb = HASHgetlink(h,hb))                            \
                if (simple_EQ(v, BUNhloc(bi, hb), TYPE))
 
 #define HASHloop_bit(bi, h, hb, v)     HASHloop_TYPE(bi, h, hb, v, bte)
@@ -2987,9 +3009,9 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b
 #define HASHloop_ptr(bi, h, hb, v)     HASHloop_TYPE(bi, h, hb, v, ptr)
 
 #define HASHloop_any(bi, h, hb, v)                             \
-       for (hb = (h)->hash[hash_any(h, v)];                    \
-            hb != BUN_NONE;                                    \
-            hb = (h)->link[hb])                                \
+       for (hb = HASHget(h, hash_any(h, v));                   \
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to