Changeset: 7be3e67f0299 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7be3e67f0299
Modified Files:
        MacOSX/post-install.sh
        clients/python2/monetdb/mapi.py
        clients/python3/monetdb/mapi.py
        monetdb5/modules/atoms/mtime.c
        sql/storage/bat/bat_storage.c
        sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.sql
        sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out
        sql/test/pg_regress/Tests/box.stable.err
        sql/test/pg_regress/Tests/path.stable.err
        sql/test/pg_regress/Tests/point.stable.err
        sql/test/pg_regress/Tests/polygon.stable.err
Branch: default
Log Message:

merged with Jun2016


diffs (truncated from 460 to 300 lines):

diff --git a/MacOSX/post-install.sh b/MacOSX/post-install.sh
--- a/MacOSX/post-install.sh
+++ b/MacOSX/post-install.sh
@@ -2,6 +2,14 @@
 
 monetdb_path=/usr/local/monetdb/bin
 
-if [[ ":$PATH:" != *":$monetdb_path:"* ]]; then
-    printf '\n# Set MonetDB path\nexport PATH=$PATH:'$monetdb_path'\n' >> 
~/.profile
-fi
+case $PATH in
+*:$monetdb_path|*:$monetdb_path:*|$monetdb_path:*)
+    ;;
+*)
+    cat >> ~/.profile <<EOF
+
+# Set MonetDB path
+export PATH=\$PATH:$monetdb_path
+EOF
+    ;;
+esac
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
@@ -142,8 +142,9 @@ class Connection(object):
                 logger.info("redirect to monetdb://%s:%s/%s" %
                             (self.hostname, self.port, self.database))
                 self.socket.close()
-                self.connect(self.hostname, self.port, self.username,
-                             self.password, self.database, self.language)
+                self.connect(hostname=self.hostname, port=self.port,
+                             username=self.username, password=self.password,
+                             database=self.database, language=self.language)
 
             else:
                 raise ProgrammingError("unknown redirect: %s" % prompt)
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
@@ -143,8 +143,9 @@ class Connection(object):
                 logger.info("redirect to monetdb://%s:%s/%s" %
                             (self.hostname, self.port, self.database))
                 self.socket.close()
-                self.connect(self.hostname, self.port, self.username,
-                             self.password, self.database, self.language)
+                self.connect(hostname=self.hostname, port=self.port,
+                             username=self.username, password=self.password,
+                             database=self.database, language=self.language)
 
             else:
                 raise ProgrammingError("unknown redirect: %s" % prompt)
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -1664,7 +1664,7 @@ BATcleanProps( BAT *b )
 }
 
 static int 
-gtr_update_delta( sql_trans *tr, sql_delta *cbat)
+gtr_update_delta( sql_trans *tr, sql_delta *cbat, int *changes)
 {
        int ok = LOG_OK;
        BAT *ins, *cur;
@@ -1676,6 +1676,7 @@ gtr_update_delta( sql_trans *tr, sql_del
        ins = temp_descriptor(cbat->ibid);
        /* any inserts */
        if (BUNlast(ins) > BUNfirst(ins)) {
+               (*changes)++;
                assert(cur->T->heap.storage != STORE_PRIV);
                BATappend(cur,ins,TRUE);
                cbat->cnt = cbat->ibase = BATcount(cur);
@@ -1690,6 +1691,7 @@ gtr_update_delta( sql_trans *tr, sql_del
                BAT *uv = temp_descriptor(cbat->uvbid);
                /* any updates */
                if (BUNlast(ui) > BUNfirst(ui)) {
+                       (*changes)++;
                        void_replace_bat(cur, ui, uv, TRUE);
                        temp_destroy(cbat->uibid);
                        temp_destroy(cbat->uvbid);
@@ -1709,7 +1711,7 @@ gtr_update_delta( sql_trans *tr, sql_del
 }
 
 static int
-gtr_update_dbat(sql_dbat *d)
+gtr_update_dbat(sql_dbat *d, int *changes)
 {
        int ok = LOG_OK;
        BAT *idb;
@@ -1722,6 +1724,7 @@ gtr_update_dbat(sql_dbat *d)
        if (BUNlast(idb) > idb->batInserted) {
                BAT *cdb = temp_descriptor(dbid);
 
+               (*changes)++;
                append_inserted(cdb, idb);
                bat_destroy(cdb);
        }
@@ -1731,63 +1734,80 @@ gtr_update_dbat(sql_dbat *d)
 
 
 static int
-gtr_update_table(sql_trans *tr, sql_table *t)
+gtr_update_table(sql_trans *tr, sql_table *t, int *tchanges)
 {
        int ok = LOG_OK;
        node *n;
 
-       if (!t->base.wtime)
+       if (t->base.wtime <= t->base.allocated)
                return ok;
-       gtr_update_dbat(t->data);
+       gtr_update_dbat(t->data, tchanges);
        for (n = t->columns.set->h; ok == LOG_OK && n; n = n->next) {
+               int changes = 0;
                sql_column *c = n->data;
 
-               if (!c->base.wtime) 
+               if (!c->base.wtime || c->base.wtime <= c->base.allocated) 
                        continue;
-               ok = gtr_update_delta(tr, c->data);
-               c->base.wtime = 0;
+               ok = gtr_update_delta(tr, c->data, &changes);
+               if (changes)
+                       c->base.allocated = c->base.wtime = tr->wstime;
+               (*tchanges) |= changes;
        }
        if (ok == LOG_OK && t->idxs.set) {
                for (n = t->idxs.set->h; ok == LOG_OK && n; n = n->next) {
+                       int changes = 0;
                        sql_idx *ci = n->data;
 
                        /* some indices have no bats */
-                       if (!ci->base.wtime)
+                       if (!ci->base.wtime || ci->base.wtime <= 
ci->base.allocated) 
                                continue;
 
-                       ok = gtr_update_delta(tr, ci->data);
-                       ci->base.wtime = 0;
+                       ok = gtr_update_delta(tr, ci->data, &changes);
+                       if (changes)
+                               ci->base.allocated = ci->base.wtime = 
tr->wstime;
+                       (*tchanges) |= changes;
                }
        }
-       t->base.wtime = 0;
+       if (*tchanges)
+               t->base.allocated = t->base.wtime = tr->wstime;
        return ok;
 }
 
-typedef int (*gtr_update_table_fptr)( sql_trans *tr, sql_table *t);
+typedef int (*gtr_update_table_fptr)( sql_trans *tr, sql_table *t, int 
*changes);
 
 static int
 _gtr_update( sql_trans *tr, gtr_update_table_fptr gtr_update_table_f)
 {
-       int ok = LOG_OK;
+       int ok = LOG_OK, tchanges = 0;
        node *sn;
 
        for(sn = tr->schemas.set->h; sn && ok == LOG_OK; sn = sn->next) {
+               int schanges = 0;
                sql_schema *s = sn->data;
                
-               if (!isTempSchema(s) && s->tables.set && s->base.wtime) {
+               if (s->base.wtime <= s->base.allocated && 
+                       gtr_update_table_f == gtr_update_table)
+                       continue;
+               if (!s->base.wtime)
+                       continue;
+               if (!isTempSchema(s) && s->tables.set) {
                        node *n;
                        for (n = s->tables.set->h; n && ok == LOG_OK; n = 
n->next) {
+                               int changes = 0;
                                sql_table *t = n->data;
 
                                if (isTable(t) && isGlobal(t))
-                                       ok = gtr_update_table_f(tr, t);
+                                       ok = gtr_update_table_f(tr, t, 
&changes);
+                               schanges |= changes;
                        }
                }
-               if (gtr_update_table_f == gtr_update_table)
-                       s->base.wtime = 0;
+               if (schanges && gtr_update_table_f == gtr_update_table){
+                       s->base.allocated = s->base.wtime = tr->wstime;
+                       tchanges ++;
+               }
        }
-       if (gtr_update_table_f == gtr_update_table)
-               tr->wtime = 0;
+       if (tchanges && gtr_update_table_f == gtr_update_table)
+               tr->wtime = tr->wstime;
        return LOG_OK;
 }
 
@@ -1825,11 +1845,12 @@ gtr_minmax_col( sql_trans *tr, sql_colum
 }
 
 static int
-gtr_minmax_table(sql_trans *tr, sql_table *t)
+gtr_minmax_table(sql_trans *tr, sql_table *t, int *changes)
 {
        int ok = LOG_OK;
        node *n;
 
+       (void)changes;
        if (t->access > TABLE_WRITABLE) {
                for (n = t->columns.set->h; ok == LOG_OK && n; n = n->next) {
                        sql_column *c = n->data;
diff --git a/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.sql 
b/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.sql
--- a/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.sql
+++ b/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.sql
@@ -7,13 +7,13 @@ INSERT INTO input_double VALUES ('longit
 
 
 CREATE TABLE v(a1 int, a2 point, prob double);
-insert into v values(0,sys.point(50,4),1);
-insert into v values(1,sys.point(51,5),1);
-insert into v values(2,sys.point(52,6),1);
+insert into v values(0,'point(50 4)',1);
+insert into v values(1,'point(51 5)',1);
+insert into v values(2,'point(52 6)',1);
 
 
 CREATE VIEW p AS 
-SELECT sys.point(a1,a2) AS a1, prob AS prob 
+SELECT ST_Point(a1,a2) AS a1, prob AS prob 
 FROM (
          SELECT tmp_2.a2 AS a1, tmp_3.a2 AS a2, tmp_2.prob * tmp_3.prob AS 
prob 
          FROM 
@@ -22,7 +22,7 @@ FROM (
 ) AS tmp;
 
 CREATE VIEW r AS 
-SELECT a1 AS a1, sys.distance(a2,a3) AS prob 
+SELECT a1 AS a1, ST_Distance(a2,a3) AS prob 
 FROM (
          SELECT v.a1 AS a1, v.a2 AS a2, p.a1 AS a3, v.prob * p.prob AS prob 
          FROM v,p
diff --git a/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out 
b/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out
--- a/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out
+++ b/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out
@@ -79,10 +79,10 @@ project (
 | | | | | | | ) [ input_double.a1 = clob "longitude" ]
 | | | | | | ) [ input_double.a2 as tmp_3.a2 ]
 | | | | | ) [  ]
-| | | | ) [ sys.point(tmp_2.a2 as tmp.a1, tmp_3.a2 as tmp.a2) as L.a1 ]
+| | | | ) [ sys.st_point(tmp_2.a2 as tmp.a1, tmp_3.a2 as tmp.a2) as L.a1 ]
 | | | ) [  ]
 | | ) [ v.a1, v.a2, L.a1 as p.a1 ]
-| ) [ v.a1 as L.a1, sys.distance(v.a2 as tmp.a2, p.a1 as tmp.a3) as L.prob ]
+| ) [ v.a1 as L.a1, sys.st_distance(v.a2 as tmp.a2, p.a1 as tmp.a3) as L.prob ]
 ) [ L.a1 as r.a1, L.prob as r.prob ]
 
 # 14:00:10 >  
diff --git a/sql/test/pg_regress/Tests/box.stable.err 
b/sql/test/pg_regress/Tests/box.stable.err
--- a/sql/test/pg_regress/Tests/box.stable.err
+++ b/sql/test/pg_regress/Tests/box.stable.err
@@ -31,17 +31,21 @@ stderr of test 'box` in directory 'sql/t
 
 MAPI  = (monetdb) /var/tmp/mtest-10494/.s.monetdb.39553
 QUERY = INSERT INTO BOX_TBL (f1) VALUES (MBR('(2.3, 4.5)'));
-ERROR = !ParseException: Unknown type: '('
-MAPI  = (monetdb) /var/tmp/mtest-10494/.s.monetdb.39553
+ERROR = !GEOSWKTReader_read failed
+        !ParseException: Unknown type: '('
+MAPI  = (monetdb) /var/tmp/mtest-12501/.s.monetdb.34321
 QUERY = INSERT INTO BOX_TBL (f1) VALUES (MBR('linestring(2.3, 4.5)'));
-ERROR = !ParseException: Expected number but encountered ','
-MAPI  = (monetdb) /var/tmp/mtest-10494/.s.monetdb.39553
+ERROR = !GEOSWKTReader_read failed
+        !ParseException: Expected number but encountered ','
+MAPI  = (monetdb) /var/tmp/mtest-12501/.s.monetdb.34321
 QUERY = INSERT INTO BOX_TBL (f1) VALUES (MBR('asdfasdf(ad'));
-ERROR = !ParseException: Unknown type: 'ASDFASDF'
-MAPI  = (monetdb) /var/tmp/mtest-10494/.s.monetdb.39553
+ERROR = !GEOSWKTReader_read failed
+        !ParseException: Unknown type: 'ASDFASDF'
+MAPI  = (monetdb) /var/tmp/mtest-12501/.s.monetdb.34321
 QUERY = INSERT INTO BOX_TBL (f1) VALUES (MBR('linestring(asdfasdf(ad)'));
-ERROR = !ParseException: Expected number but encountered word: 'asdfasdf'
-MAPI  = (monetdb) /var/tmp/mtest-10494/.s.monetdb.39553
+ERROR = !GEOSWKTReader_read failed
+        !ParseException: Expected number but encountered word: 'asdfasdf'
+MAPI  = (monetdb) /var/tmp/mtest-12501/.s.monetdb.34321
 QUERY = SELECT '' AS four, @@(b1.f1) AS p FROM BOX_TBL_VW b1;
 ERROR = !syntax error, unexpected AT in: "select '' as four, @@"
 MAPI  = (monetdb) /var/tmp/mtest-10494/.s.monetdb.39553
diff --git a/sql/test/pg_regress/Tests/path.stable.err 
b/sql/test/pg_regress/Tests/path.stable.err
--- a/sql/test/pg_regress/Tests/path.stable.err
+++ b/sql/test/pg_regress/Tests/path.stable.err
@@ -31,29 +31,37 @@ stderr of test 'path` in directory 'sql/
 
 MAPI  = (monetdb) /var/tmp/mtest-6648/.s.monetdb.37642
 QUERY = INSERT INTO PATH_TBL VALUES ('linestring((1 2),(3 4))');
-ERROR = !ParseException: Expected number but encountered '('
-MAPI  = (monetdb) /var/tmp/mtest-6648/.s.monetdb.37642
+ERROR = !GEOSWKTReader_read failed
+        !ParseException: Expected number but encountered '('
+MAPI  = (monetdb) /var/tmp/mtest-12501/.s.monetdb.34321
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to