Changeset: 5c8143899135 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5c8143899135
Removed Files:
        monetdb5/mal/Tests/tst550.mal
Modified Files:
        monetdb5/mal/Tests/All
        monetdb5/mal/Tests/tst285.mal
        monetdb5/mal/Tests/tst285.stable.out
        monetdb5/modules/mal/pcre.c
        monetdb5/modules/mal/pcre.mal
        sql/test/leaks/Tests/check0_gsl.stable.out
        sql/test/leaks/Tests/check1_gsl.stable.out
        sql/test/leaks/Tests/check2_gsl.stable.out
        sql/test/leaks/Tests/check3_gsl.stable.out
        sql/test/leaks/Tests/check4_gsl.stable.out
        sql/test/leaks/Tests/check5_gsl.stable.out
        sql/test/leaks/Tests/drop3_gsl.stable.out
        sql/test/leaks/Tests/select1_gsl.stable.out
        sql/test/leaks/Tests/select2_gsl.stable.out
        sql/test/leaks/Tests/temp1_gsl.stable.out
        sql/test/leaks/Tests/temp2_gsl.stable.out
        sql/test/leaks/Tests/temp3_gsl.stable.out
Branch: default
Log Message:

Reducing the MAL interface to prce
Cleaned up a series of old interfaces


diffs (truncated from 513 to 300 lines):

diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -161,7 +161,6 @@ tst400
 tst401
 tst500
 tst501
-tst550
 tst560
 tst611
 tst612
diff --git a/monetdb5/mal/Tests/tst285.mal b/monetdb5/mal/Tests/tst285.mal
--- a/monetdb5/mal/Tests/tst285.mal
+++ b/monetdb5/mal/Tests/tst285.mal
@@ -1,9 +1,11 @@
 b:= bat.new(:oid,:str);
 bat.append(b,"hello");
 bat.append(b,"goodbye");
+o:=bat.new(:oid,:oid);
 
-z1:= batstr.like_uselect(b,"%hel%");
-io.print(z1);
+p:= bat.new(:oid,:str);
+bat.append(p,"%hel%");
 
-z2:= pcre.uselect(".*[ly].*", b);
-io.print(z2);
+(z0,z1):= algebra.likesubselect(b,p,"");
+io.print(z0,z1);
+
diff --git a/monetdb5/mal/Tests/tst285.stable.out 
b/monetdb5/mal/Tests/tst285.stable.out
--- a/monetdb5/mal/Tests/tst285.stable.out
+++ b/monetdb5/mal/Tests/tst285.stable.out
@@ -26,22 +26,17 @@ function user.main():void;
     b := bat.new(:oid,:str);
     bat.append(b,"hello");
     bat.append(b,"goodbye");
-    z1 := batstr.like_uselect(b,"%hel%");
-    io.print(z1);
-    z2 := pcre.uselect(".*[ly].*",b);
-    io.print(z2);
+    o := bat.new(:oid,:oid);
+    p := bat.new(:oid,:str);
+    bat.append(p,"%hel%");
+    (z0,z1) := algebra.likesubselect(b,p,"");
+    io.print(z0,z1);
 end main;
-#-----------------#
-# h    tmp_5     # name
-# int  bit       # type
-#-----------------#
-[ 0@0,   nil     ]
-#-----------------#
-# h    tmp_6     # name
-# int  bit       # type
-#-----------------#
-[ 0@0,   nil     ]
-[ 1@0,   nil     ]
+#--------------------------#
+# t    h       h  # name
+# void oid     oid  # type
+#--------------------------#
+[ 0@0, 0@0,    0@0  ]
 
 # 08:01:12 >  
 # 08:01:12 >  Done.
diff --git a/monetdb5/mal/Tests/tst550.mal b/monetdb5/mal/Tests/tst550.mal
deleted file mode 100644
--- a/monetdb5/mal/Tests/tst550.mal
+++ /dev/null
@@ -1,6 +0,0 @@
-# use of the lock module
-l:= lock.create();
-lock.set(l);
-i:=lock.try(l);
-lock.unset(l);
-lock.destroy(l);
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -57,16 +57,6 @@ pcre_export str PCREpatindex(int *ret, s
 pcre_export str PCREreplace_wrap(str *res, str *or, str *pat, str *repl, str 
*flags);
 pcre_export str PCREreplace_bat_wrap(int *res, int *or, str *pat, str *repl, 
str *flags);
 
-pcre_export str PCREcompile_wrap(pcre **res, str *pattern);
-pcre_export str PCREexec_wrap(bit *res, pcre *pattern, str *s);
-pcre_export int pcre_tostr(str *tostr, int *l, pcre *p);
-pcre_export int pcre_fromstr(const char *instr, int *l, pcre **val);
-pcre_export int pcre_nequal(pcre *l, pcre *r);
-pcre_export BUN pcre_hash(pcre *b);
-pcre_export pcre *pcre_null(void);
-pcre_export void pcre_del(Heap *h, var_t *index);
-pcre_export int pcre_length(pcre *p);
-pcre_export void pcre_heap(Heap *heap, size_t capacity);
 pcre_export var_t pcre_put(Heap *h, var_t *bun, pcre *val);
 pcre_export str PCREsql2pcre(str *ret, str *pat, str *esc);
 pcre_export str PCRElike3(bit *ret, str *s, str *pat, str *esc);
@@ -86,13 +76,8 @@ pcre_export str BATPCREilike2(int *ret, 
 pcre_export str BATPCREnotilike(int *ret, int *b, str *pat, str *esc);
 pcre_export str BATPCREnotilike2(int *ret, int *b, str *pat);
 pcre_export str PCREselectDef(int *res, str *pattern, int *bid);
-pcre_export str PCREuselectDef(int *res, str *pattern, int *bid);
-pcre_export str PCRElike_uselect_pcre(int *ret, int *b, str *pat, str *esc);
-pcre_export str PCREilike_uselect_pcre(int *ret, int *b, str *pat, str *esc);
 pcre_export str PCRElike_join_pcre(int *l, int *r, int *b, int *pat, str *esc);
 pcre_export str PCREilike_join_pcre(int *l, int *r, int *b, int *pat, str 
*esc);
-pcre_export str PCRElike_select_pcre(int *ret, int *b, str *pat, str *esc);
-pcre_export str PCREilike_select_pcre(int *ret, int *b, str *pat, str *esc);
 pcre_export str pcre_init(void);
 pcre_export str PCRElikesubselect1(bat *ret, bat *bid, str *pat, str *esc, bit 
*caseignore, bit *anti);
 pcre_export str PCRElikesubselect2(bat *ret, bat *bid, bat *sid, str *pat, str 
*esc, bit *caseignore, bit *anti);
@@ -996,83 +981,6 @@ pcre_match_with_flags(bit *ret, const ch
        return MAL_SUCCEED;
 }
 
-int
-pcre_tostr(str *tostr, int *l, pcre *p)
-{
-       (void) tostr;
-       (void) l;
-       (void) p;
-       return GDK_FAIL;
-}
-
-int
-pcre_fromstr(const char *instr, int *l, pcre **val)
-{
-       (void) instr;
-       (void) l;
-       (void) val;
-       return GDK_FAIL;
-}
-
-int
-pcre_nequal(pcre *l, pcre *r)
-{
-       if (l != r)
-               return 0;
-       else
-               return 1;
-}
-
-BUN
-pcre_hash(pcre *b)
-{
-       return *(sht *) b;
-}
-
-pcre *
-pcre_null(void)
-{
-       static sht nullval, *r;
-
-       nullval = ~(sht) 0;
-       r = &nullval;
-       return (pcre *) r;
-}
-
-void
-pcre_del(Heap *h, var_t *idx)
-{
-       HEAP_free(h, *idx);
-}
-
-#define pcresize(val) ((size_t*)val)[0]
-
-var_t
-pcre_put(Heap *h, var_t *bun, pcre *val)
-{
-       char *base;
-
-       assert(pcresize(val) <= VAR_MAX);
-       *bun = HEAP_malloc(h, (var_t) pcresize(val));
-       base = h->base;
-       if (*bun)
-               memcpy(&base[*bun << GDK_VARSHIFT], (char *) val, 
pcresize(val));
-       return *bun;
-}
-
-int
-pcre_length(pcre *p)
-{
-       assert(pcresize(p) <= GDK_int_max);
-       return (int) (pcresize(p));
-}
-
-void
-pcre_heap(Heap *heap, size_t capacity)
-{
-       HEAP_initialize(heap, capacity, 0, (int) sizeof(var_t));
-}
-
 /* change SQL LIKE pattern into PCRE pattern */
 static str
 sql2pcre(str *r, const char *pat, const char *esc_str)
@@ -1207,23 +1115,6 @@ PCREreplace_bat_wrap(int *res, int *bid,
        return msg;
 }
 
-str
-PCREcompile_wrap(pcre **res, str *pattern)
-{
-       return pcre_compile_wrap(res, *pattern, FALSE);
-}
-
-str
-PCREexec_wrap(bit *res, pcre *pattern, str *s)
-{
-       if (pcre_exec(m2p(pattern), NULL, *s, (int) strlen(*s), 0, 0, NULL, 0) 
>= 0) {
-               *res = TRUE;
-               return MAL_SUCCEED;
-       }
-       *res = FALSE;
-       throw(MAL, "pcre.exec", OPERATION_FAILED);
-}
-
 static str
 PCREselect(int *res, str *pattern, int *bid, bit *ignore)
 {
@@ -1274,13 +1165,6 @@ PCREuselect(int *res, str *pattern, int 
 }
 
 str
-PCREuselectDef(int *res, str *pattern, int *bid)
-{
-       bit ignore = FALSE;
-       return(PCREuselect(res, pattern, bid, &ignore));
-}
-
-str
 PCREmatch(bit *ret, str *val, str *pat)
 {
        char *flags = "";
@@ -1777,29 +1661,6 @@ PCRElike_pcre(int *ret, int *b, str *pat
        return r;
 }
 
-str
-PCRElike_uselect_pcre(int *ret, int *b, str *pat, str *esc)
-{
-       return PCRElike_pcre(ret,b,pat,esc,TRUE,FALSE);
-}
-
-str
-PCREilike_uselect_pcre(int *ret, int *b, str *pat, str *esc)
-{
-       return PCRElike_pcre(ret,b,pat,esc,TRUE,TRUE);
-}
-
-str
-PCRElike_select_pcre(int *ret, int *b, str *pat, str *esc)
-{
-       return PCRElike_pcre(ret,b,pat,esc,FALSE,FALSE);
-}
-
-str
-PCREilike_select_pcre(int *ret, int *b, str *pat, str *esc)
-{
-       return PCRElike_pcre(ret,b,pat,esc,FALSE,TRUE);
-}
 
 static str
 PCRElike_join(int *l, int *r, int *b, int *pat, str *esc, int case_sensitive)
@@ -1831,10 +1692,10 @@ PCRElike_join(int *l, int *r, int *b, in
                str err;
 
                if (case_sensitive) {
-                       if ((err = PCRElike_uselect_pcre( &r, b, &ppat, esc)) 
!= MAL_SUCCEED)
+                       if ((err = PCRElike_pcre( &r, b, &ppat, esc, TRUE, 
FALSE)) != MAL_SUCCEED)
                                return err;
                } else {
-                       if ((err = PCREilike_uselect_pcre( &r, b, &ppat, esc)) 
!= MAL_SUCCEED)
+                       if ((err = PCRElike_pcre( &r, b, &ppat, esc, 
TRUE,TRUE)) != MAL_SUCCEED)
                                return err;
                }
 
diff --git a/monetdb5/modules/mal/pcre.mal b/monetdb5/modules/mal/pcre.mal
--- a/monetdb5/modules/mal/pcre.mal
+++ b/monetdb5/modules/mal/pcre.mal
@@ -15,25 +15,7 @@
 # Copyright August 2008-2014 MonetDB B.V.
 # All Rights Reserved.
 
-atom pcre:ptr;
-command tostr()   address pcre_tostr;
-command fromstr() address pcre_fromstr;
-command nequal()  address pcre_nequal;
-command hash()    address pcre_hash;
-command null()    address pcre_null;
-command put()     address pcre_put;
-command del()     address pcre_del;
-command length()  address pcre_length;
-command heap()    address pcre_heap;
-
-command compile(pat:str):pcre
-address PCREcompile_wrap
-comment "compile a pattern";
-
-command match(pat:pcre, s:str) :bit
-address PCREexec_wrap
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to