Changeset: a9dfaff84910 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a9dfaff84910
Branch: pushcands
Log Message:

Merged with default


diffs (154 lines):

diff --git a/documentation/index.rst b/documentation/index.rst
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -16,6 +16,9 @@ Welcome to MonetDB's documentation!
    monetdbe/examples
    monetdbe/installation
    monetdbe/monetdbe_api
+   monetdbe/manual_pages/monetdbe_open
+   monetdbe/manual_pages/monetdbe_options
+   monetdbe/manual_pages/monetdbe_remote
    source/intro
    source/build
    source/build-fedora
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1,7 +1,7 @@
 /*
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
  */
@@ -628,14 +628,27 @@ fullscan_str(BAT *b, struct canditer *re
        case 1: {
                const unsigned char *ptr = (const unsigned char *) Tloc(b, 0);
                pos -= GDK_VAROFFSET;
-               for (p = 0; p < ci->ncand; p++) {
-                       o = canditer_next(ci);
-                       if (ptr[o - hseq] == pos) {
-                               buninsfix(bn, dst, cnt, o,
-                                         (BUN) ((dbl) cnt / (dbl) (p == 0 ? 1 
: p)
-                                                * (dbl) (ci->ncand-p) * 1.1 + 
1024),
-                                         maximum, BUN_NONE);
-                               cnt++;
+               if (ci->tpe == cand_dense) {
+                       for (p = 0; p < ci->ncand; p++) {
+                               o = canditer_next_dense(ci);
+                               if (ptr[o - hseq] == pos) {
+                                       buninsfix(bn, dst, cnt, o,
+                                               (BUN) ((dbl) cnt / (dbl) (p == 
0 ? 1 : p)
+                                                       * (dbl) (ci->ncand-p) * 
1.1 + 1024),
+                                               maximum, BUN_NONE);
+                                       cnt++;
+                               }
+                       }
+               } else {
+                       for (p = 0; p < ci->ncand; p++) {
+                               o = canditer_next(ci);
+                               if (ptr[o - hseq] == pos) {
+                                       buninsfix(bn, dst, cnt, o,
+                                               (BUN) ((dbl) cnt / (dbl) (p == 
0 ? 1 : p)
+                                                       * (dbl) (ci->ncand-p) * 
1.1 + 1024),
+                                               maximum, BUN_NONE);
+                                       cnt++;
+                               }
                        }
                }
                break;
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -92,6 +92,7 @@ mal_export void mal_reset(void);
 #define LIST_MAL_MAPI  32       /* output Mapi compatible output */
 #define LIST_MAL_REMOTE  64       /* output MAL for remote execution */
 #define LIST_MAL_FLOW   128       /* output MAL dataflow dependencies */
+#define LIST_MAL_ALGO  256               /* output algorithm used */
 #define LIST_MAL_CALL  (LIST_MAL_NAME | LIST_MAL_VALUE )
 #define LIST_MAL_DEBUG (LIST_MAL_NAME | LIST_MAL_VALUE | LIST_MAL_TYPE | 
LIST_MAL_PROPS | LIST_MAL_FLOW)
 #define LIST_MAL_ALL   (LIST_MAL_NAME | LIST_MAL_VALUE | LIST_MAL_TYPE | 
LIST_MAL_MAPI)
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -351,7 +351,7 @@ instruction2str(MalBlkPtr mb, MalStkPtr 
        case CMDcall:
        case ASSIGNsymbol :
                // is any variable explicit or used
-               /* this code was meant to make it easy to detect functions 
whose 
+               /* this code was meant to make it easy to detect functions whose
                 * result variable was not used anywhere.
                 * It is not essential
                for (i = 0; i < p->retc; i++)
@@ -484,12 +484,14 @@ instruction2str(MalBlkPtr mb, MalStkPtr 
                        }
                }
        }
-       const char *algo = MT_thread_getalgorithm();
-       if (algo) {
-               if (!copystring(&t, " # ", &len))
-                       return base;
-               if (!copystring(&t, algo, &len))
-                       return base;
+       if (flg & LIST_MAL_ALGO) {
+               const char *algo = MT_thread_getalgorithm();
+               if (algo) {
+                       if (!copystring(&t, " # ", &len))
+                               return base;
+                       if (!copystring(&t, algo, &len))
+                               return base;
+               }
        }
        return base;
 }
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -783,7 +783,7 @@ sqlProfilerEvent(Client cntxt, MalBlkPtr
                return;
 
        /* generate actual call statement */
-       stmt = instruction2str(mb, stk, pci, LIST_MAL_ALL);
+       stmt = instruction2str(mb, stk, pci, LIST_MAL_ALL | LIST_MAL_ALGO);
        c = stmt;
 
        while (c && *c && (isspace((unsigned char)*c) || *c == '!'))
diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -32,6 +32,8 @@ query_cleaned(sql_allocator *sa, const c
        bool bs = false;                /* seen a backslash in a quoted string 
*/
        bool incomment1 = false;        /* inside traditional C style comment */
        bool incomment2 = false;        /* inside comment starting with --  */
+       bool inline_comment = false;
+
        r = SA_NEW_ARRAY(sa, char, strlen(query) + 1);
        if(!r)
                return NULL;
@@ -44,10 +46,13 @@ query_cleaned(sql_allocator *sa, const c
                } else if (incomment2) {
                        if (*query == '\n') {
                                incomment2 = false;
+                               inline_comment = false;
                                /* add newline only if comment doesn't
                                 * occupy whole line */
                                if (q > r && q[-1] != '\n')
                                        *q++ = '\n';
+                       } else if (inline_comment){
+                               *q++ = *query; // preserve in line query 
comments
                        }
                } else if (quote) {
                        if (bs) {
@@ -65,6 +70,10 @@ query_cleaned(sql_allocator *sa, const c
                        quote = '}';
                        *q++ = *query;
                } else if (*query == '-' && query[1] == '-') {
+                       if (q > r && q[-1] != '\n') {
+                               inline_comment = true;
+                               *q++ = *query; // preserve in line query 
comments
+                       }
                        incomment2 = true;
                } else if (*query == '/' && query[1] == '*') {
                        incomment1 = true;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to