Changeset: 448668661f66 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=448668661f66
Modified Files:
        sql/backends/monet5/LSST/Tests/htmxmatch.sql
Branch: default
Log Message:

Merge


diffs (truncated from 2078 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1224,7 +1224,7 @@
 #endif
        printf(LLFMT " tuple%s%s%s%s", rows, rows != 1 ? "s" : "",
                        singleinstr ? " (" : "",
-                       singleinstr ? timerHuman() : "",
+                       singleinstr && formatter != TESTformatter ? 
timerHuman() : "",
                        singleinstr ? ")" : "");
 
        if (fields != printfields || croppedfields > 0)
@@ -1394,7 +1394,7 @@
                                                        (aff == 1 ? "" : "s"),
                                                        lid,
                                                        singleinstr ? " (" : "",
-                                                       singleinstr ? 
timerHuman() : "",
+                                                       singleinstr && 
formatter != TESTformatter ? timerHuman() : "",
                                                        singleinstr ? ")" : "");
                                } else {
                                        mnstr_printf(toConsole,
@@ -1402,7 +1402,7 @@
                                                        aff,
                                                        (aff == 1 ? "" : "s"),
                                                        singleinstr ? " (" : "",
-                                                       singleinstr ? 
timerHuman() : "",
+                                                       singleinstr && 
formatter != TESTformatter ? timerHuman() : "",
                                                        singleinstr ? ")" : "");
                                }
                        }
@@ -1414,7 +1414,7 @@
                                mnstr_printf(toConsole,
                                              "operation successful%s%s%s\n",
                                              singleinstr ? " (" : "",
-                                             singleinstr ? timerHuman() : "",
+                                             singleinstr && formatter != 
TESTformatter ? timerHuman() : "",
                                              singleinstr ? ")" : "");
                        continue;
                case Q_TRANS:
diff --git a/monetdb5/modules/mal/batExtensions.mx 
b/monetdb5/modules/mal/batExtensions.mx
--- a/monetdb5/modules/mal/batExtensions.mx
+++ b/monetdb5/modules/mal/batExtensions.mx
@@ -40,6 +40,10 @@
 address CMDBATnew
 comment "Creates a new empty transient BAT,
        with head- and tail-types as indicated.";
+pattern bat.new(ht:any_1, tt:bat[:any_2,:any_3]) :bat[:any_1,:bat]     
+address CMDBATnew
+comment "Creates a new empty transient BAT,
+       with head- and tail-types as indicated.";
 pattern bat.new(ht:any_1, tt:any_2, size:int) :bat[:any_1,:any_2]      
 address CMDBATnewint
 comment "Creates a new BAT with sufficient space.";
diff --git a/sql/backends/monet5/LSST/Tests/All 
b/sql/backends/monet5/LSST/Tests/All
--- a/sql/backends/monet5/LSST/Tests/All
+++ b/sql/backends/monet5/LSST/Tests/All
@@ -1,1 +1,1 @@
-htmxmatch
+lsst_htmxmatch
diff --git a/sql/backends/monet5/LSST/Tests/htmxmatch.sql 
b/sql/backends/monet5/LSST/Tests/lsst_htmxmatch.sql
rename from sql/backends/monet5/LSST/Tests/htmxmatch.sql
rename to sql/backends/monet5/LSST/Tests/lsst_htmxmatch.sql
--- a/sql/backends/monet5/LSST/Tests/htmxmatch.sql
+++ b/sql/backends/monet5/LSST/Tests/lsst_htmxmatch.sql
@@ -9,3 +9,5 @@
 
 -- select pairs at distance one
 select  * from htm a, htm b where a.id xmatch(1) b.id;
+
+drop table htm;
diff --git a/sql/backends/monet5/sql_scenario.mx 
b/sql/backends/monet5/sql_scenario.mx
--- a/sql/backends/monet5/sql_scenario.mx
+++ b/sql/backends/monet5/sql_scenario.mx
@@ -407,6 +407,7 @@
 {
        mvc *m;
        str schema;
+       str msg = MAL_SUCCEED;
        backend *be;
        bstream *bfd = NULL;
        stream *fd = NULL;
@@ -480,7 +481,6 @@
                                        filename = p + 1;
 
                                if (fd) {
-                                       str msg = MAL_SUCCEED;
                                        bfd = bstream_create(fd, 128 * BLOCK);
                                        if (bfd && bstream_next(bfd) >= 0)
                                                msg = SQLstatementIntern(c, 
&bfd->buf, "sql.init", TRUE, FALSE);
@@ -488,10 +488,8 @@
                                        if (m->sa)
                                                sa_destroy(m->sa);
                                        m->sa = NULL;
-                                       if (msg) {
-                                               GDKfree(fullname);
-                                               return msg;
-                                       }
+                                       if (msg) 
+                                               p = NULL;
                                }
                        } while (p);
                        GDKfree(fullname);
@@ -500,7 +498,14 @@
        }
        fflush(stdout);
        fflush(stderr);
-       return MAL_SUCCEED;
+
+       /* send error from create scripts back to the first client */
+       if (msg) {
+               error(c->fdout, msg);
+               handle_error(m, c->fdout, 0);
+               sqlcleanup(m, mvc_status(m));
+       }
+       return msg;
 }
 
 str
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out 
b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
--- a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
+++ b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out
@@ -59,7 +59,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   6       ]
+[ "joinidx",   7       ]
 
 # 11:48:05 >  
 # 11:48:05 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
@@ -855,7 +855,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   0       ]
+[ "joinidx",   1       ]
 
 # 11:48:06 >  
 # 11:48:06 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out 
b/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
--- a/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
+++ b/sql/benchmarks/tpch/LOCKED/Tests/02.stable.out
@@ -37,7 +37,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   6       ]
+[ "joinidx",   7       ]
 
 # 09:17:12 >  
 # 09:17:12 >  Done.
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/17.stable.out 
b/sql/benchmarks/tpch/LOCKED/Tests/17.stable.out
--- a/sql/benchmarks/tpch/LOCKED/Tests/17.stable.out
+++ b/sql/benchmarks/tpch/LOCKED/Tests/17.stable.out
@@ -33,7 +33,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   0       ]
+[ "joinidx",   1       ]
 
 # 09:17:19 >  
 # 09:17:19 >  Done.
diff --git a/sql/benchmarks/tpch/Tests/01-22.stable.out 
b/sql/benchmarks/tpch/Tests/01-22.stable.out
--- a/sql/benchmarks/tpch/Tests/01-22.stable.out
+++ b/sql/benchmarks/tpch/Tests/01-22.stable.out
@@ -59,7 +59,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   6       ]
+[ "joinidx",   7       ]
 
 # 11:48:05 >  
 # 11:48:05 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
@@ -855,7 +855,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   0       ]
+[ "joinidx",   1       ]
 
 # 11:48:06 >  
 # 11:48:06 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781
diff --git a/sql/benchmarks/tpch/Tests/02.stable.out 
b/sql/benchmarks/tpch/Tests/02.stable.out
--- a/sql/benchmarks/tpch/Tests/02.stable.out
+++ b/sql/benchmarks/tpch/Tests/02.stable.out
@@ -37,7 +37,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   6       ]
+[ "joinidx",   7       ]
 
 # 09:17:12 >  
 # 09:17:12 >  Done.
diff --git a/sql/benchmarks/tpch/Tests/17.stable.out 
b/sql/benchmarks/tpch/Tests/17.stable.out
--- a/sql/benchmarks/tpch/Tests/17.stable.out
+++ b/sql/benchmarks/tpch/Tests/17.stable.out
@@ -33,7 +33,7 @@
 % rewrite,     count # name
 % clob,        int # type
 % 7,   1 # length
-[ "joinidx",   0       ]
+[ "joinidx",   1       ]
 
 # 09:17:19 >  
 # 09:17:19 >  Done.
diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h
--- a/sql/include/sql_relation.h
+++ b/sql/include/sql_relation.h
@@ -163,7 +163,7 @@
 #define is_semi(op) \
        (op == op_semi || op == op_anti)
 #define is_select(op) \
-       (op == op_select /*|| op == op_semi || op == op_anti*/)
+       (op == op_select)
 #define is_set(op) \
        (op == op_union || op == op_inter || op == op_except)
 #define is_union(op) \
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -1014,7 +1014,7 @@
        from relation f into expression of relation t 
 */ 
 
-static sql_exp * exp_push_down(mvc *sql, sql_exp *e, sql_rel *f, sql_rel *t);
+static sql_exp * _exp_push_down(mvc *sql, sql_exp *e, sql_rel *f, sql_rel *t);
 
 static list *
 exps_push_down(mvc *sql, list *exps, sql_rel *f, sql_rel *t)
@@ -1025,7 +1025,7 @@
        for(n = exps->h; n; n=n->next) {
                sql_exp *arg = n->data;
 
-               arg = exp_push_down(sql, arg, f, t);
+               arg = _exp_push_down(sql, arg, f, t);
                if (!arg) 
                        return NULL;
                append(nl, arg);
@@ -1034,25 +1034,19 @@
 }
 
 static sql_exp *
-exp_push_down(mvc *sql, sql_exp *e, sql_rel *f, sql_rel *t) 
+_exp_push_down(mvc *sql, sql_exp *e, sql_rel *f, sql_rel *t) 
 {
        int flag = e->flag;
        sql_exp *ne = NULL, *l, *r, *r2;
 
-       if (is_join(f->op) || is_select(f->op)) {
-               if (f->l && (ne = exp_push_down(sql, e, f->l, t)) != NULL)
-                       return ne;
-               if (f->r && (ne = exp_push_down(sql, e, f->r, t)) != NULL) 
-                       return ne;
-       }
        switch(e->type) {
        case e_column:
                if (e->l) { 
-                       ne = exps_bind_column2(f->exps, e->l, e->r);
+                       ne = rel_bind_column2(sql, f, e->l, e->r, 0);
                        /* if relation name matches expressions relation name, 
find column based on column name alone */
                }
                if (!ne && !e->l)
-                       ne = exps_bind_column(f->exps, e->r, NULL);
+                       ne = rel_bind_column(sql, f, e->r, 0);
                if (!ne)
                        return NULL;
                e = NULL;
@@ -1081,10 +1075,10 @@
                                return NULL;
                        return exp_or(sql->sa, l, r);
                } else {
-                       l = exp_push_down(sql, e->l, f, t);
-                       r = exp_push_down(sql, e->r, f, t);
+                       l = _exp_push_down(sql, e->l, f, t);
+                       r = _exp_push_down(sql, e->r, f, t);
                        if (e->f) {
-                               r2 = exp_push_down(sql, e->f, f, t);
+                               r2 = _exp_push_down(sql, e->f, f, t);
                                if (l && r && r2)
                                        return exp_compare2(sql->sa, l, r, r2, 
e->flag);
                        } else if (l && r) {
@@ -1093,7 +1087,7 @@
                }
                return NULL;
        case e_convert:
-               l = exp_push_down(sql, e->l, f, t);
+               l = _exp_push_down(sql, e->l, f, t);
                if (l)
                        return exp_convert(sql->sa, l, exp_fromtype(e), 
exp_totype(e));
                return NULL;
@@ -1119,6 +1113,13 @@
        return NULL;
 }
 
+static sql_exp *
+exp_push_down(mvc *sql, sql_exp *e, sql_rel *f, sql_rel *t) 
+{
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to