Changeset: 747bf20b4cb3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/747bf20b4cb3
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_statement.c
Branch: pushcands
Log Message:

Merged with default


diffs (63 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -958,10 +958,12 @@ mvc_next_value_bulk(Client cntxt, MalBlk
                sqlvar_set_number(find_global_var(be->mvc, 
mvc_bind_schema(be->mvc, "sys"), "last_id"), be->last_id);
                lng c = start;
                for(BUN i = 0; i<card; i++) {
-                       if (c > maxv && minv && maxv)
-                               c = minv;
-                       if (c > maxv && !minv)
-                               break;
+                       if (maxv && c > maxv) {
+                               if (minv)
+                                       c = minv;
+                               else
+                                       break;
+                       }
                        rb[i] = c;
                        if ((i+1) < card)
                                c += inc;
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
@@ -52,7 +52,7 @@ typedef struct expression {
         nulls_last:1,  /* return null after all other rows */
         zero_if_empty:1,       /* in case of partial aggregator computation, 
some aggregators need to return 0 instead of NULL */
         distinct:1,
-        argument_independence:1, /* compare between symmetric */
+        argument_independence:1, /* for a function expression, the arguments 
are independent of the inner project relation. */
 
         semantics:1,   /* is vs = semantics (nil = nil vs unknown != unknown), 
ranges with or without nil, aggregation with or without nil */
         need_no_nil:1,
diff --git a/sql/storage/store_sequence.c b/sql/storage/store_sequence.c
--- a/sql/storage/store_sequence.c
+++ b/sql/storage/store_sequence.c
@@ -170,7 +170,7 @@ seqbulk_next_value(sql_store store, sql_
        lng nr = 0;
        node *n = NULL;
        store_sequence *s;
-       int save = 0;
+       bool save = false;
 
        store_lock(store);
        for ( n = sql_seqs->h; n; n = n ->next ) {
@@ -194,8 +194,7 @@ seqbulk_next_value(sql_store store, sql_
        s->called = 1;
        *start = s->cur;
        *inc = seq->increment;
-       if (seq->cycle)
-               *minv = seq->minvalue;
+       *minv = seq->cycle ? seq->minvalue : 0;
        *maxv = seq->maxvalue;
        for(lng i = 0; i < cnt; i++) {
                /* handle min/max and cycle */
@@ -205,7 +204,7 @@ seqbulk_next_value(sql_store store, sql_
                        if (seq->cycle) {
                                /* cycle to the min value again */
                                s->cur = seq->minvalue;
-                               save = 1;
+                               save = true;
                        } else { /* we're out of numbers */
                                store_unlock(store);
                                return 0;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to