Changeset: 36cf4ed1b85f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=36cf4ed1b85f
Modified Files:
        clients/Tests/exports.stable.out
        clients/python/monetdb/sql/cursors.py
        clients/python/monetdb/sql/monetize.py
        configure.ag
        gdk/gdk.h
        gdk/gdk_private.h
        gdk/gdk_qsort.c
        gdk/gdk_search.c
        gdk/gdk_select.c
        gdk/gdk_setop.mx
        gdk/gdk_ssort.c
        gdk/gdk_ssort_impl.h
        monetdb5/extras/jaql/parser/jaql.l
        monetdb5/extras/mal_optimizer_template/opt_sql_append.c
        monetdb5/mal/Tests/tst1200.stable.out
        monetdb5/mal/Tests/tst1201.stable.out
        monetdb5/mal/Tests/tst1202.stable.out
        monetdb5/mal/Tests/tst1203.stable.out
        monetdb5/mal/Tests/tst1205.stable.out
        monetdb5/mal/Tests/tst850.stable.out
        monetdb5/mal/Tests/tst901b.mal
        monetdb5/mal/Tests/tst901b.stable.out
        monetdb5/mal/Tests/tst902.mal
        monetdb5/mal/Tests/tst902.stable.out
        monetdb5/mal/Tests/tst903.stable.out
        monetdb5/mal/Tests/tst904.stable.out
        monetdb5/mal/Tests/tst905.stable.out
        monetdb5/mal/Tests/tst907.stable.out
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_profiler.c
        monetdb5/modules/kernel/algebra.mx
        monetdb5/modules/kernel/batmtime.mx
        monetdb5/modules/mal/Tests/modulechk.mal
        monetdb5/modules/mal/Tests/modulechk.stable.out
        monetdb5/modules/mal/language.c
        monetdb5/modules/mal/pcre.c
        monetdb5/modules/mal/pcre.mal
        monetdb5/modules/mal/profiler.c
        monetdb5/optimizer/Tests/Mexample.stable.out
        monetdb5/optimizer/Tests/remap.stable.out
        monetdb5/optimizer/opt_multiplex.c
        sql/backends/monet5/sql.mx
        sql/server/sql_parser.h
        sql/server/sql_parser.y
        sql/server/sql_scan.c
        sql/test/Tests/trace.stable.out
        tools/mserver/Makefile.ag
        tools/mserver/mserver5.c
Branch: sciql
Log Message:

Merge with default branch.


diffs (truncated from 5232 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
@@ -176,6 +176,7 @@ BAT *BATsubselect(BAT *b, BAT *s, const 
 BAT *BATsunion(BAT *b, BAT *c);
 BAT *BATsunique(BAT *b);
 BAT *BATthetajoin(BAT *l, BAT *r, int mode, BUN estimate);
+BAT *BATthetasubselect(BAT *b, BAT *s, const void *val, const char *op);
 int BATtopN(BAT *b, BUN topN);
 BAT *BATundo(BAT *b);
 BAT *BATuselect(BAT *b, const void *tl, const void *th);
@@ -245,8 +246,8 @@ int GDKms(void);
 int GDKnr_threads;
 void GDKprotect(void);
 int GDKprotected;
-void GDKqsort(void *h, void *t, void *base, size_t n, int hs, int ts, int tpe);
-void GDKqsort_rev(void *h, void *t, void *base, size_t n, int hs, int ts, int 
tpe);
+void GDKqsort(void *h, void *t, const void *base, size_t n, int hs, int ts, 
int tpe);
+void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int hs, int 
ts, int tpe);
 void *GDKrealloc(void *pold, size_t size);
 void GDKsetenv(str name, str value);
 ssize_t GDKstrFromStr(unsigned char *dst, const unsigned char *src, ssize_t 
len);
@@ -746,6 +747,8 @@ str ALGtdiff(int *result, int *lid, int 
 str ALGthetajoin(int *result, int *lid, int *rid, int *opc);
 str ALGthetajoinEstimate(int *result, int *lid, int *rid, int *opc, lng 
*estimate);
 str ALGthetaselect(int *result, int *bid, ptr low, str *op);
+str ALGthetasubselect1(bat *result, bat *bid, const void *val, const char 
**op);
+str ALGthetasubselect2(bat *result, bat *bid, bat *sid, const void *val, const 
char **op);
 str ALGthetauselect(int *result, int *bid, ptr value, str *op);
 str ALGthsort(int *result, int *lid);
 str ALGtintersect(int *result, int *lid, int *rid);
@@ -1771,60 +1774,6 @@ void MSresetInstructions(MalBlkPtr mb, i
 void MSresetVariables(Client cntxt, MalBlkPtr mb, MalStkPtr glb, int start);
 void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout);
 void MSserveClient(void *dummy);
-str MTIMEaccum_date_EQ(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_date_EQ_cst(int *ret, int *r, int *l, date *cst);
-str MTIMEaccum_date_GE(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_date_GE_cst(int *ret, int *r, int *l, date *cst);
-str MTIMEaccum_date_GT(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_date_GT_cst(int *ret, int *r, int *l, date *cst);
-str MTIMEaccum_date_LE(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_date_LE_cst(int *ret, int *r, int *l, date *cst);
-str MTIMEaccum_date_LT(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_date_LT_cst(int *ret, int *r, int *l, date *cst);
-str MTIMEaccum_date_NEQ(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_date_NEQ_cst(int *ret, int *r, int *l, date *cst);
-str MTIMEaccum_date_cst_EQ(int *ret, int *r, date *cst, int *l);
-str MTIMEaccum_date_cst_GE(int *ret, int *r, date *cst, int *l);
-str MTIMEaccum_date_cst_GT(int *ret, int *r, date *cst, int *l);
-str MTIMEaccum_date_cst_LE(int *ret, int *r, date *cst, int *l);
-str MTIMEaccum_date_cst_LT(int *ret, int *r, date *cst, int *l);
-str MTIMEaccum_date_cst_NEQ(int *ret, int *r, date *cst, int *l);
-str MTIMEaccum_daytime_EQ(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_daytime_EQ_cst(int *ret, int *r, int *l, daytime *cst);
-str MTIMEaccum_daytime_GE(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_daytime_GE_cst(int *ret, int *r, int *l, daytime *cst);
-str MTIMEaccum_daytime_GT(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_daytime_GT_cst(int *ret, int *r, int *l, daytime *cst);
-str MTIMEaccum_daytime_LE(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_daytime_LE_cst(int *ret, int *r, int *l, daytime *cst);
-str MTIMEaccum_daytime_LT(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_daytime_LT_cst(int *ret, int *r, int *l, daytime *cst);
-str MTIMEaccum_daytime_NEQ(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_daytime_NEQ_cst(int *ret, int *r, int *l, daytime *cst);
-str MTIMEaccum_daytime_cst_EQ(int *ret, int *r, daytime *cst, int *l);
-str MTIMEaccum_daytime_cst_GE(int *ret, int *r, daytime *cst, int *l);
-str MTIMEaccum_daytime_cst_GT(int *ret, int *r, daytime *cst, int *l);
-str MTIMEaccum_daytime_cst_LE(int *ret, int *r, daytime *cst, int *l);
-str MTIMEaccum_daytime_cst_LT(int *ret, int *r, daytime *cst, int *l);
-str MTIMEaccum_daytime_cst_NEQ(int *ret, int *r, daytime *cst, int *l);
-str MTIMEaccum_timestamp_EQ(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_timestamp_EQ_cst(int *ret, int *r, int *l, timestamp *cst);
-str MTIMEaccum_timestamp_GE(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_timestamp_GE_cst(int *ret, int *r, int *l, timestamp *cst);
-str MTIMEaccum_timestamp_GT(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_timestamp_GT_cst(int *ret, int *r, int *l, timestamp *cst);
-str MTIMEaccum_timestamp_LE(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_timestamp_LE_cst(int *ret, int *r, int *l, timestamp *cst);
-str MTIMEaccum_timestamp_LT(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_timestamp_LT_cst(int *ret, int *r, int *l, timestamp *cst);
-str MTIMEaccum_timestamp_NEQ(int *ret, int *d, int *l, int *r);
-str MTIMEaccum_timestamp_NEQ_cst(int *ret, int *r, int *l, timestamp *cst);
-str MTIMEaccum_timestamp_cst_EQ(int *ret, int *r, timestamp *cst, int *l);
-str MTIMEaccum_timestamp_cst_GE(int *ret, int *r, timestamp *cst, int *l);
-str MTIMEaccum_timestamp_cst_GT(int *ret, int *r, timestamp *cst, int *l);
-str MTIMEaccum_timestamp_cst_LE(int *ret, int *r, timestamp *cst, int *l);
-str MTIMEaccum_timestamp_cst_LT(int *ret, int *r, timestamp *cst, int *l);
-str MTIMEaccum_timestamp_cst_NEQ(int *ret, int *r, timestamp *cst, int *l);
 str MTIMEbat_date_EQ(int *ret, int *l, int *r);
 str MTIMEbat_date_EQ_cst(int *ret, int *l, date *cst);
 str MTIMEbat_date_GE(int *ret, int *l, int *r);
@@ -2108,6 +2057,8 @@ str PCRElike3(bit *ret, str *s, str *pat
 str PCRElike_join_pcre(int *ret, int *b, int *pat, str *esc);
 str PCRElike_select_pcre(int *ret, int *b, str *pat, str *esc);
 str PCRElike_uselect_pcre(int *ret, int *b, str *pat, str *esc);
+str PCRElikesubselect1(bat *ret, bat *bid, str *pat, str *esc, bit 
*caseignore, bit *anti);
+str PCRElikesubselect2(bat *ret, bat *bid, bat *sid, str *pat, str *esc, bit 
*caseignore, bit *anti);
 str PCREmatch(bit *ret, str *val, str *pat);
 str PCREnotilike2(bit *ret, str *s, str *pat);
 str PCREnotilike3(bit *ret, str *s, str *pat, str *esc);
diff --git a/clients/python/monetdb/sql/cursors.py 
b/clients/python/monetdb/sql/cursors.py
--- a/clients/python/monetdb/sql/cursors.py
+++ b/clients/python/monetdb/sql/cursors.py
@@ -158,6 +158,9 @@ class Cursor(object):
         # clear message history
         self.messages = []
 
+        # convert to utf-8
+        operation = unicode(operation).encode('utf-8')
+
         # set the number of rows to fetch
         self.connection.command('Xreply_size %s' % self.arraysize)
 
@@ -172,12 +175,8 @@ class Cursor(object):
             if isinstance(parameters, dict):
                 query = operation % dict([(k, monetize.convert(v))
                     for (k,v) in parameters.items()])
-            elif type(parameters) == list:
-                query = operation % tuple([monetize.convert(item)
-                    for item in parameters])
-            elif type(parameters) == tuple:
-                query = operation % tuple([monetize.convert(item)
-                    for item in parameters])
+            elif type(parameters) == list or type(parameters) == tuple:
+                query = operation % tuple([monetize.convert(item) for item in 
parameters])
             elif isinstance(parameters, str):
                 query = operation % monetize.convert(parameters)
             else:
diff --git a/clients/python/monetdb/sql/monetize.py 
b/clients/python/monetdb/sql/monetize.py
--- a/clients/python/monetdb/sql/monetize.py
+++ b/clients/python/monetdb/sql/monetize.py
@@ -22,6 +22,7 @@ functions for converting python objects 
 import datetime
 import decimal
 
+from monetdb.exceptions import ProgrammingError
 
 def monet_none(data):
     """
@@ -76,4 +77,9 @@ def convert(data):
     try:
         return mapping[type(data)](data)
     except KeyError:
-        raise ProgrammingError("type %s not supported as value" % type(data))
\ No newline at end of file
+        if hasattr(data, '__unicode__'):
+            return unicode(data).encode('utf-8')
+        elif hasattr(data, '__str__'):
+            return str(data)
+        else:
+            raise ProgrammingError("type %s not supported as value" % 
type(data))
\ No newline at end of file
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1648,28 +1648,30 @@ if test "x$have_pthread" != xno; then
        esac
        CPPFLAGS="$save_CPPFLAGS"
 
-       case $GCC in
-               yes)
+       save_LIBS="$LIBS"
+       save_CPPFLAGS="$CPPFLAGS"
+       case $GCC-$have_pthread in
+               yes-auto|yes-yes)
                        # use GCC's knowledge about the target platform, sets 
flags
                        # for both the preprocessor as well as the linker
-                       PTHREAD_INCS="$PTHREAD_INCS -pthread"
-                       PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
-                       CPPFLAGS="$CPPFLAGS -pthread"
-                       LIBS="$LIBS -pthread"
+                       PTHREAD_INCS="-pthread"
+                       PTHREAD_LIBS="-pthread"
+                       CPPFLAGS="$CPPFLAGS $PTHREAD_INCS"
+                       LIBS="$LIBS $PTHREAD_LIBS"
                ;;
                *)
-                       save_LIBS="$LIBS"
                        # ok, do old-fashioned stuff
-                       LIBS="$LIBS $PTHREAD_LIBS" # in case user did 
--with-pthreads
+                       CPPFLAGS="$CPPFLAGS $PTHREAD_INCS" # in case user did 
--with-pthreads
+                       LIBS="$LIBS $PTHREAD_LIBS"
                        pthread_found=yes
                        AC_SEARCH_LIBS([sem_init], [pthreadGC2 pthreadGC1 
pthreadGC pthread],
-                               [PTHREAD_LIBS="$PTHREAD_LIBS 
$ac_cv_search_sem_init"],
+                               [LIBS="$LIBS $ac_cv_search_sem_init"],
                                [pthread_found=no])
                        if test x"$pthread_found" = xno ; then
                                pthread_found=yes
                                dnl sun
                                AC_SEARCH_LIBS([sem_post], [pthread],
-                                       [PTHREAD_LIBS="$PTHREAD_LIBS -lpthread 
-lposix4"],
+                                       [LIBS="$LIBS -lpthread -lposix4"],
                                        [pthread_found=no],
                                        "-lposix4")
                        fi
@@ -1677,7 +1679,7 @@ if test "x$have_pthread" != xno; then
                                pthread_found=yes
                                dnl hp-ux
                                AC_SEARCH_LIBS([sem_post], [pthread],
-                                       [PTHREAD_LIBS="$PTHREAD_LIBS -lpthread 
-lrt"],
+                                       [LIBS="$LIBS -lpthread -lrt"],
                                        [pthread_found=no],
                                        "-lrt")
                        fi
@@ -1687,7 +1689,7 @@ if test "x$have_pthread" != xno; then
                                fi
                                have_pthread=no
                        fi
-                       LIBS="$save_LIBS"
+                       PTHREAD_LIBS="$LIBS"
                ;;
        esac
 
@@ -1706,11 +1708,9 @@ if test "x$have_pthread" != xno; then
        dnl this function very ugly is overloaded with semaphore stuff
        dnl so we DO need to check for it, for platforms which have it
        dnl in a separate lib, like Solaris
-       oldLIBS="$LIBS"
-       LIBS="$PTHREAD_LIBS"
        AC_SEARCH_LIBS(sem_wait, rt)
-       PTHREAD_LIBS="$LIBS"
-       LIBS="$oldLIBS"
+
+       LIBS="$save_LIBS"
        CPPFLAGS="$save_CPPFLAGS"
 
 fi
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1683,8 +1683,8 @@ gdk_export int BATordered_rev(BAT *b);
 gdk_export BAT *BATssort(BAT *b);
 gdk_export BAT *BATssort_rev(BAT *b);
 
-gdk_export void GDKqsort(void *h, void *t, void *base, size_t n, int hs, int 
ts, int tpe);
-gdk_export void GDKqsort_rev(void *h, void *t, void *base, size_t n, int hs, 
int ts, int tpe);
+gdk_export void GDKqsort(void *h, void *t, const void *base, size_t n, int hs, 
int ts, int tpe);
+gdk_export void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int 
hs, int ts, int tpe);
 
 #define BAThordered(b) ((b)->htype == TYPE_void || (b)->hsorted)
 #define BATtordered(b) ((b)->ttype == TYPE_void || (b)->tsorted)
@@ -3139,6 +3139,7 @@ gdk_export int BATtopN(BAT *b, BUN topN)
 #define JOIN_BAND      3
 
 gdk_export BAT *BATsubselect(BAT *b, BAT *s, const void *tl, const void *th, 
int li, int hi, int anti);
+gdk_export BAT *BATthetasubselect(BAT *b, BAT *s, const void *val, const char 
*op);
 gdk_export BAT *BATselect_(BAT *b, const void *tl, const void *th, bit li, bit 
hi);
 gdk_export BAT *BATuselect_(BAT *b, const void *tl, const void *th, bit li, 
bit hi);
 gdk_export BAT *BATantiuselect_(BAT *b, const void *tl, const void *th, bit 
li, bit hi);
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -69,8 +69,8 @@ int GDKmunmap(void *addr, size_t len);
 void *GDKreallocmax(void *pold, size_t size, size_t *maxsize, int emergency);
 int GDKremovedir(const char *nme);
 int GDKsave(const char *nme, const char *ext, void *buf, size_t size, 
storage_t mode);
-int GDKssort_rev(void *h, void *t, void *base, size_t n, int hs, int ts, int 
tpe);
-int GDKssort(void *h, void *t, void *base, size_t n, int hs, int ts, int tpe);
+int GDKssort_rev(void *h, void *t, const void *base, size_t n, int hs, int ts, 
int tpe);
+int GDKssort(void *h, void *t, const void *base, size_t n, int hs, int ts, int 
tpe);
 int GDKunlink(const char *dir, const char *nme, const char *extension);
 int HASHgonebad(BAT *b, const void *v);
 BUN HASHmask(BUN cnt);
diff --git a/gdk/gdk_qsort.c b/gdk/gdk_qsort.c
--- a/gdk/gdk_qsort.c
+++ b/gdk/gdk_qsort.c
@@ -25,7 +25,7 @@ struct qsort_t {
        unsigned int hs;
        unsigned int ts;
        int (*cmp)(const void *, const void *);
-       char *base;
+       const char *base;
 };
 
 /* return index of middle value at indexes a, b, and c */
@@ -293,7 +293,7 @@ struct qsort_t {
 
 /* the interface functions */
 void
-GDKqsort(void *h, void *t, void *base, size_t n, int hs, int ts, int tpe)
+GDKqsort(void *h, void *t, const void *base, size_t n, int hs, int ts, int tpe)
 {
        struct qsort_t buf;
 
@@ -340,7 +340,7 @@ GDKqsort(void *h, void *t, void *base, s
 }
 
 void
-GDKqsort_rev(void *h, void *t, void *base, size_t n, int hs, int ts, int tpe)
+GDKqsort_rev(void *h, void *t, const void *base, size_t n, int hs, int ts, int 
tpe)
 {
        struct qsort_t buf;
 
diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -459,6 +459,18 @@ SORTfndwhich(BAT *b, const void *v, int 
        if (b == NULL || (!b->tsorted && !b->trevsorted))
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to