Changeset: 68f53eb16440 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68f53eb16440
Added Files:
        sql/test/miscellaneous/Tests/table_udf_missing_var.py
        sql/test/miscellaneous/Tests/table_udf_missing_var.stable.err
        sql/test/miscellaneous/Tests/table_udf_missing_var.stable.out
Modified Files:
        clients/mapiclient/stethoscope.c
        clients/mapilib/mapi.c
        configure.ag
        gdk/Makefile.ag
        gdk/gdk_calc.c
        gdk/gdk_join.c
        gdk/gdk_utils.c
        sql/backends/monet5/UDF/capi/capi.c
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_statement.c
        sql/server/rel_optimizer.c
        sql/test/miscellaneous/Tests/All
        tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Merged with Jun2020


diffs (truncated from 2970 to 300 lines):

diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -79,7 +79,7 @@ static FILE *trace ;
  * Tuple level reformatting
  */
 
-static void
+static _Noreturn void
 usageStethoscope(void)
 {
     fprintf(stderr, "stethoscope [options] \n");
@@ -210,20 +210,14 @@ main(int argc, char **argv)
                        break;
                case '?':
                        usageStethoscope();
-                       /* a bit of a hack: look at the option that the
-                          current `c' is based on and see if we recognize
-                          it: if -? or --help, exit with 0, else with -1 */
-                       exit(strcmp(argv[optind - 1], "-?") == 0 || 
strcmp(argv[optind - 1], "--help") == 0 ? 0 : -1);
                default:
                        usageStethoscope();
-                       exit(-1);
                }
        }
 
 
        if(dbname == NULL){
                usageStethoscope();
-               exit(-1);
        }
 
        if(debug)
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1248,6 +1248,8 @@ void
 mapi_noexplain(Mapi mid, const char *errorprefix)
 {
        assert(mid);
+       if (mid->noexplain)
+               free(mid->noexplain);
        mid->noexplain = errorprefix ? strdup(errorprefix) : NULL;
 }
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -810,7 +810,7 @@ AC_MSG_CHECKING([for --enable-optimize])
 AS_CASE([$enable_optimize], [yes], [
        # if optimizing *and* enable-strict, use FORTIFY_SOURCE
        AS_VAR_IF([enable_strict], [yes], [
-               CFLAGS="-D_FORTIFY_SOURCE=2 $CFLAGS"])
+               MCHECK_ADD_FLAG([-D_FORTIFY_SOURCE=2])])
        origCFLAGS="$CFLAGS"
        # remove "-O2" as we add "-Ox" and some compilers don't like "-Oy -Ox" 
combinations
        CFLAGS=`AS_ECHO([" $CFLAGS "]) | sed -e 's| -O2 | |g' -e 's|^ ||' -e 
's| $||'`
diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -12,34 +12,45 @@ lib_gdk = {
        VERSION = $(GDK_VERSION)
        NAME = bat
        SOURCES = \
+               gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \
                gdk_select.c \
-               gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \
+               gdk_analytic_bounds.c gdk_analytic.h \
+               gdk_qsort.c gdk_qsort_impl.h \
                gdk_ssort.c gdk_ssort_impl.h \
                gdk_aggr.c \
-               gdk.h gdk_batop.c \
-               gdk_cand.h gdk_cand.c \
-               gdk_search.c gdk_hash.c gdk_hash.h gdk_tm.c \
+               gdk_analytic_func.c \
+               gdk_bbp.c gdk_bbp.h \
+               gdk_group.c \
+               gdk_join.c \
+               gdk_firstn.c \
+               gdk_logger.c gdk_logger.h gdk_geomlogger.h 
gdk_logger_internals.h \
+               gdk_batop.c \
+               gdk_bat.c \
+               gdk_hash.c gdk_hash.h \
+               gdk_utils.c gdk_utils.h \
+               gdk_imprints.c gdk_imprints.h \
+               gdk_atoms.c gdk_atoms.h \
+               gdk_project.c \
+               gdk_string.c \
                gdk_orderidx.c \
-               gdk_align.c gdk_bbp.c gdk_bbp.h \
-               gdk_heap.c gdk_utils.c gdk_utils.h \
-               gdk_atoms.c gdk_atoms.h gdk_string.c \
-               gdk_qsort.c gdk_qsort_impl.h \
-               gdk_storage.c gdk_bat.c \
-               gdk_delta.c gdk_cross.c gdk_system.c gdk_value.c \
-               gdk_posix.c gdk_logger.c gdk_sample.c xoshiro256starstar.h \
-               gdk_private.h gdk_delta.h gdk_logger.h gdk_posix.h \
-               gdk_system.h gdk_system_private.h gdk_tm.h gdk_storage.h \
-               gdk_geomlogger.h gdk_logger_internals.h \
-               gdk_group.c \
-               gdk_imprints.c gdk_imprints.h \
-               gdk_join.c gdk_project.c \
+               gdk_search.c \
+               gdk_heap.c \
+               gdk_storage.c gdk_storage.h \
                gdk_time.c gdk_time.h \
+               gdk_cand.c gdk_cand.h \
                gdk_unique.c \
+               gdk_posix.c gdk_posix.h \
+               gdk_system.c gdk_system.h gdk_system_private.h \
+               gdk_tracer.c gdk_tracer.h \
+               gdk_align.c \
                gdk_interprocess.c gdk_interprocess.h \
-               gdk_firstn.c \
-               gdk_analytic_bounds.c \
-               gdk_analytic_func.c gdk_analytic.h \
-               gdk_tracer.c gdk_tracer.h \
+               gdk_sample.c \
+               gdk_tm.c gdk_tm.h \
+               gdk_value.c \
+               gdk_delta.c gdk_delta.h \
+               gdk_cross.c \
+               gdk.h gdk_private.h \
+               xoshiro256starstar.h \
                libbat.rc
        LIBS = ../common/options/libmoptions \
                ../common/utils/libmutils \
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -94,19 +94,37 @@ checkbats(BAT *b1, BAT *b2, const char *
 
 #define BINARY_3TYPE_FUNC(TYPE1, TYPE2, TYPE3, FUNC)                   \
        do {                                                            \
-               for (k = 0; k < ci1->ncand; k++) {                      \
-                       x1 = canditer_next(ci1) - candoff1;             \
-                       x2 = canditer_next(ci2) - candoff2;             \
-                       i = x1 * incr1;                                 \
-                       j = x2 * incr2;                                 \
-                       TYPE1 v1 = ((const TYPE1 *) lft)[i];            \
-                       TYPE2 v2 = ((const TYPE2 *) rgt)[j];            \
-                       if ((rv != NULL && !rv[i]) ||                   \
-                           is_##TYPE1##_nil(v1) || is_##TYPE2##_nil(v2)) { \
-                               nils++;                                 \
-                               ((TYPE3 *) dst)[k] = TYPE3##_nil;       \
-                       } else {                                        \
-                               ((TYPE3 *) dst)[k] = FUNC(v1, v2);      \
+               if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) { \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next_dense(ci1) - candoff1; \
+                               x2 = canditer_next_dense(ci2) - candoff2; \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               if ((rv != NULL && !rv[i]) ||           \
+                                   is_##TYPE1##_nil(v1) || 
is_##TYPE2##_nil(v2)) { \
+                                       nils++;                         \
+                                       ((TYPE3 *) dst)[k] = TYPE3##_nil; \
+                               } else {                                \
+                                       ((TYPE3 *) dst)[k] = FUNC(v1, v2); \
+                               }                                       \
+                       }                                               \
+               } else {                                                \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next(ci1) - candoff1;     \
+                               x2 = canditer_next(ci2) - candoff2;     \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               if ((rv != NULL && !rv[i]) ||           \
+                                   is_##TYPE1##_nil(v1) || 
is_##TYPE2##_nil(v2)) { \
+                                       nils++;                         \
+                                       ((TYPE3 *) dst)[k] = TYPE3##_nil; \
+                               } else {                                \
+                                       ((TYPE3 *) dst)[k] = FUNC(v1, v2); \
+                               }                                       \
                        }                                               \
                }                                                       \
        } while (0)
@@ -115,61 +133,119 @@ checkbats(BAT *b1, BAT *b2, const char *
  * when it is set */
 #define BINARY_3TYPE_FUNC_nilmatch(TYPE1, TYPE2, TYPE3, FUNC)          \
        do {                                                            \
-               for (k = 0; k < ci1->ncand; k++) {                      \
-                       x1 = canditer_next(ci1) - candoff1;             \
-                       x2 = canditer_next(ci2) - candoff2;             \
-                       i = x1 * incr1;                                 \
-                       j = x2 * incr2;                                 \
-                       TYPE1 v1 = ((const TYPE1 *) lft)[i];            \
-                       TYPE2 v2 = ((const TYPE2 *) rgt)[j];            \
-                       if ((rv != NULL && !rv[i]) ||                   \
-                           is_##TYPE1##_nil(v1) || is_##TYPE2##_nil(v2)) { \
-                               ((TYPE3 *) dst)[k] = FUNC(is_##TYPE1##_nil(v1), 
is_##TYPE2##_nil(v2)); \
-                       } else {                                        \
-                               ((TYPE3 *) dst)[k] = FUNC(v1, v2);      \
+               if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) { \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next_dense(ci1) - candoff1; \
+                               x2 = canditer_next_dense(ci2) - candoff2; \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               if ((rv != NULL && !rv[i]) ||           \
+                                   is_##TYPE1##_nil(v1) || 
is_##TYPE2##_nil(v2)) { \
+                                       ((TYPE3 *) dst)[k] = 
FUNC(is_##TYPE1##_nil(v1), is_##TYPE2##_nil(v2)); \
+                               } else {                                \
+                                       ((TYPE3 *) dst)[k] = FUNC(v1, v2); \
+                               }                                       \
+                       }                                               \
+               } else {                                                \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next(ci1) - candoff1;     \
+                               x2 = canditer_next(ci2) - candoff2;     \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               if ((rv != NULL && !rv[i]) ||           \
+                                   is_##TYPE1##_nil(v1) || 
is_##TYPE2##_nil(v2)) { \
+                                       ((TYPE3 *) dst)[k] = 
FUNC(is_##TYPE1##_nil(v1), is_##TYPE2##_nil(v2)); \
+                               } else {                                \
+                                       ((TYPE3 *) dst)[k] = FUNC(v1, v2); \
+                               }                                       \
                        }                                               \
                }                                                       \
        } while (0)
 
 #define BINARY_3TYPE_FUNC_nonil(TYPE1, TYPE2, TYPE3, FUNC)             \
        do {                                                            \
-               for (k = 0; k < ci1->ncand; k++) {                      \
-                       x1 = canditer_next(ci1) - candoff1;             \
-                       x2 = canditer_next(ci2) - candoff2;             \
-                       i = x1 * incr1;                                 \
-                       j = x2 * incr2;                                 \
-                       TYPE1 v1 = ((const TYPE1 *) lft)[i];            \
-                       TYPE2 v2 = ((const TYPE2 *) rgt)[j];            \
-                       ((TYPE3 *) dst)[k] = FUNC(v1, v2);              \
+               if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) { \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next_dense(ci1) - candoff1; \
+                               x2 = canditer_next_dense(ci2) - candoff2; \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               ((TYPE3 *) dst)[k] = FUNC(v1, v2);      \
+                       }                                               \
+               } else {                                                \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next(ci1) - candoff1;     \
+                               x2 = canditer_next(ci2) - candoff2;     \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               ((TYPE3 *) dst)[k] = FUNC(v1, v2);      \
+                       }                                               \
                }                                                       \
        } while (0)
 
 #define BINARY_3TYPE_FUNC_CHECK(TYPE1, TYPE2, TYPE3, FUNC, CHECK)      \
        do {                                                            \
-               for (k = 0; k < ci1->ncand; k++) {                      \
-                       x1 = canditer_next(ci1) - candoff1;             \
-                       x2 = canditer_next(ci2) - candoff2;             \
-                       i = x1 * incr1;                                 \
-                       j = x2 * incr2;                                 \
-                       TYPE1 v1 = ((const TYPE1 *) lft)[i];            \
-                       TYPE2 v2 = ((const TYPE2 *) rgt)[j];            \
-                       if ((rv != NULL && !rv[i]) ||                   \
-                           is_##TYPE1##_nil(v1) || is_##TYPE2##_nil(v2)) { \
-                               nils++;                                 \
-                               ((TYPE3 *) dst)[k] = TYPE3##_nil;       \
-                       } else if (CHECK(v1, v2)) {                     \
-                               if (abort_on_error) {                   \
-                                       GDKerror("%s: shift operand too large 
in " \
-                                                
#FUNC"("FMT##TYPE1","FMT##TYPE2").\n", \
-                                                func,                  \
-                                                CST##TYPE1 v1,         \
-                                                CST##TYPE2 v2);        \
-                                       goto checkfail;                 \
+               if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) { \
+                       for (k = 0; k < ci1->ncand; k++) {              \
+                               x1 = canditer_next_dense(ci1) - candoff1; \
+                               x2 = canditer_next_dense(ci2) - candoff2; \
+                               i = x1 * incr1;                         \
+                               j = x2 * incr2;                         \
+                               TYPE1 v1 = ((const TYPE1 *) lft)[i];    \
+                               TYPE2 v2 = ((const TYPE2 *) rgt)[j];    \
+                               if ((rv != NULL && !rv[i]) ||           \
+                                   is_##TYPE1##_nil(v1) || 
is_##TYPE2##_nil(v2)) { \
+                                       nils++;                         \
+                                       ((TYPE3 *) dst)[k] = TYPE3##_nil; \
+                               } else if (CHECK(v1, v2)) {             \
+                                       if (abort_on_error) {           \
+                                               GDKerror("%s: shift operand too 
large in " \
+                                                        
#FUNC"("FMT##TYPE1","FMT##TYPE2").\n", \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to