MonetDB: gdk_tracer - Added some test cases, exposed GDKtracer_l...

2019-12-03 Thread Thodoris Zois
Changeset: 94305ef7b1f1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=94305ef7b1f1
Modified Files:
monetdb5/modules/mal/Tests/tracer00.malC
monetdb5/modules/mal/tracer.c
monetdb5/modules/mal/tracer.mal
Branch: gdk_tracer
Log Message:

Added some test cases, exposed GDKtracer_log for testing only to the MAL layer


diffs (30 lines):

diff --git a/monetdb5/modules/mal/Tests/tracer00.malC 
b/monetdb5/modules/mal/Tests/tracer00.malC
--- a/monetdb5/modules/mal/Tests/tracer00.malC
+++ b/monetdb5/modules/mal/Tests/tracer00.malC
@@ -125,4 +125,4 @@ logging.resetadapter();
 
 # log & flush
 logging.log();
-logging.flush();
\ No newline at end of file
+logging.flush();
diff --git a/monetdb5/modules/mal/tracer.c b/monetdb5/modules/mal/tracer.c
--- a/monetdb5/modules/mal/tracer.c
+++ b/monetdb5/modules/mal/tracer.c
@@ -130,4 +130,4 @@ TRACERlog(void)
 TRC_INFO(MAL_DATAFLOW, "An INFO message\n");
 
 return MAL_SUCCEED;
-}
\ No newline at end of file
+}
diff --git a/monetdb5/modules/mal/tracer.mal b/monetdb5/modules/mal/tracer.mal
--- a/monetdb5/modules/mal/tracer.mal
+++ b/monetdb5/modules/mal/tracer.mal
@@ -45,4 +45,4 @@ comment "Reset the adapter";
 # Exposed only in MAL layer - for testing
 command log()
 address TRACERlog
-comment "Create a log message";
\ No newline at end of file
+comment "Create a log message";
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: gdk_tracer - Added some test cases, exposed GDKtracer_l...

2019-12-03 Thread Thodoris Zois
Changeset: 427934ea7ca0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=427934ea7ca0
Modified Files:
gdk/gdk_tracer.c
monetdb5/modules/mal/Tests/tracer00.malC
monetdb5/modules/mal/tracer.c
monetdb5/modules/mal/tracer.h
monetdb5/modules/mal/tracer.mal
Branch: gdk_tracer
Log Message:

Added some test cases, exposed GDKtracer_log for testing only to the MAL layer


diffs (212 lines):

diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c
--- a/gdk/gdk_tracer.c
+++ b/gdk/gdk_tracer.c
@@ -545,4 +545,6 @@ GDKtracer_show_info(void)
 {
 mnstr_printf(GDKstdout, "# %s\n", LAYER_STR[i]);
 }
+
+return GDK_SUCCEED;
 }
diff --git a/monetdb5/modules/mal/Tests/tracer00.malC 
b/monetdb5/modules/mal/Tests/tracer00.malC
--- a/monetdb5/modules/mal/Tests/tracer00.malC
+++ b/monetdb5/modules/mal/Tests/tracer00.malC
@@ -1,4 +1,15 @@
-# Test SQL API for TRACER
+# 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/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+#
+# Test SQL API for TRACER:
+# In some test cases (marked with #WARNING) the argument used is supposed to 
be 
+# an enum entry used to count the number of elements (e.g: COMPONENTS_COUNT in 
+# gdk_tracer.h). Thus, in those cases an error should be raised. However, 
adding 
+# new entries to the enum will affect the marked test cases and they won't 
fail.
+
 
 # logging.setcomplevel(...)
 logging.setcomplevel(-1, 1);# Should raise an error
@@ -11,9 +22,19 @@ logging.setcomplevel(-10, -1);  # Should
 # Component -10 does not exist
 # Log level -1 does not exist
 
+# WARNING
 logging.setcomplevel(1, 5); # Should raise an error
 # The last level is used for enum count
 
+# WARNING
+logging.setcomplevel(98, 3);# Should raise an error
+# The last component is used for enum count
+
+# WARNING
+logging.setcomplevel(98, 5);# Should raise an error
+# The last component is used for enum count
+# The last level is used for enum count
+
 logging.setcomplevel(1, 4); # OK
 
 
@@ -22,6 +43,10 @@ logging.setcomplevel(1, 4); # OK
 logging.resetcomplevel(-1); # Should raise an error
 # Component -1 does not exist
 
+# WARNING
+logging.resetcomplevel(98); # Should raise an error
+# The last component is used for enum count
+
 logging.resetcomplevel(1);  # OK
 
 
@@ -37,17 +62,20 @@ logging.setlayerlevel(-10, -1); # Should
 # Layer -10 does not exist
 # Log level -1 does not exist
 
+# WARNING
 logging.setlayerlevel(4, 2);# Should raise an error
 # The last layer is used for enum count
 
+# WARNING
 logging.setlayerlevel(1, 5);# Should raise an error
 # The last level is used for enum count
 
+# WARNING
 logging.setlayerlevel(4, 5);# Should raise an error
 # The last layer is used for enum count
 # The last level is used for enum count
 
-logging.setlayerlevel(1, 3);# OK
+logging.setlayerlevel(1, 2);# OK
 
 
 
@@ -55,6 +83,7 @@ logging.setlayerlevel(1, 3);# OK
 logging.resetlayerlevel(-1);# Should raise an error
 # Layer -1 does not exist
 
+# WARNING
 logging.resetlayerlevel(4); # Should raise an error
 # The last layer is used for enum count   
 
@@ -66,6 +95,7 @@ logging.resetlayerlevel(1); # OK
 logging.setflushlevel(-1); # Should raise an error
# Level -1 does not exist
 
+# WARNING
 logging.setflushlevel(5);  # Should raise an error
# The last level is used for enum count
 
@@ -81,6 +111,7 @@ logging.resetflushlevel();
 logging.setadapter(-1);# Should raise an error
# Adapter -1 does not exist
 
+# WARNING
 logging.setadapter(2); # Should raise an error
# The last adapter is used for enum count
 
@@ -89,3 +120,9 @@ logging.setadapter(1); # OK
 
 
 logging.resetadapter();
+
+
+
+# log & flush
+logging.log();
+logging.flush();
\ No newline at end of file
diff --git a/monetdb5/modules/mal/tracer.c b/monetdb5/modules/mal/tracer.c
--- a/monetdb5/modules/mal/tracer.c
+++ b/monetdb5/modules/mal/tracer.c
@@ -4,6 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+ * 
+ * 
+ * GDKtracer exposes routines where an occuring failure 

MonetDB: gdk_tracer - Merge with default

2019-12-03 Thread Thodoris Zois
Changeset: 997f91f8093f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=997f91f8093f
Modified Files:
NT/rules.msc
buildtools/doc/windowsbuild.rst
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
debian/monetdb5-server.install
gdk/ChangeLog
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/ChangeLog
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/Tests/inspect05.malC
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
sql/backends/monet5/sql_statement.c
sql/include/sql_relation.h
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/rel_unnest.h
sql/server/sql_atom.c
sql/server/sql_atom.h
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c

sql/test/BugTracker-2013/Tests/cannot_use_columns_after_groupby.Bug-3340.sql

sql/test/BugTracker-2013/Tests/cannot_use_columns_after_groupby.Bug-3340.stable.err

sql/test/BugTracker-2013/Tests/cannot_use_columns_after_groupby.Bug-3340.stable.out
sql/test/BugTracker-2017/Tests/groupby_assertion.Bug-6338.stable.err

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-coalesce-error-message.Bug-6608.stable.err
sql/test/mergetables/Tests/sqlsmith-exists.sql
sql/test/mergetables/Tests/sqlsmith-exists.stable.out
sql/test/scanner/Tests/raw_strings.stable.err
sql/test/scanner/Tests/raw_strings.stable.out
sql/test/subquery/Tests/subquery.sql
sql/test/subquery/Tests/subquery.stable.err
sql/test/subquery/Tests/subquery.stable.out
sql/test/subquery/Tests/subquery3.sql
sql/test/subquery/Tests/subquery3.stable.err
sql/test/subquery/Tests/subquery3.stable.out
Branch: gdk_tracer
Log Message:

Merge with default


diffs (truncated from 2672 to 300 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -139,14 +139,19 @@ bzip2_CFLAGS = -DHAVE_LIBBZ2 "-I$(LIBBZI
 !IFNDEF LIBXML2
 LIBXML2 = C:\libxml2-2.6.30.win$(bits)
 !ENDIF
-libxml2_CFLAGS = -DHAVE_LIBXML "-I$(LIBXML2)\include" $(zlib_CFLAGS) 
$(ICONV_CFLAGS)
+# by default libxml2 include files get installed in ...\include\libxml2\libxml
+# but this has sometimes been moved to ...\include\libxml
+libxml2_CFLAGS = -DHAVE_LIBXML "-I$(LIBXML2)\include\libxml2" 
"-I$(LIBXML2)\include" $(zlib_CFLAGS) $(ICONV_CFLAGS)
 libxml2_LIBS = "$(LIBXML2)\lib\libxml2.lib" $(zlib_LIBS) $(ICONV_LIBS)
 !ENDIF
 
 !IFNDEF LIBGEOS
 LIBGEOS = C:\geos-3.0.win$(bits)
 !ENDIF
-GEOS_LIBS = $(LIBGEOS)\lib\geos_c_i.lib
+!IFNDEF GEOSFILE
+GEOSFILE = geos_c
+!ENDIF
+GEOS_LIBS = $(LIBGEOS)\lib\$(GEOSFILE).lib
 GEOS_INCS = -I$(LIBGEOS)\include
 
 !IFDEF HAVE_LIBR
diff --git a/buildtools/doc/windowsbuild.rst b/buildtools/doc/windowsbuild.rst
--- a/buildtools/doc/windowsbuild.rst
+++ b/buildtools/doc/windowsbuild.rst
@@ -243,6 +243,8 @@ PCRE (Perl Compatible Regular Expression
 The PCRE__ library is used to extend the string matching capabilities
 of MonetDB.  The PCRE library is required for the monetdb5 component.
 
+.. _pcre_cmake:
+
 Download the source from http://www.pcre.org/.  In order to build the
 library, you will need a program called ``cmake`` which you can
 download from http://www.cmake.org/ or by using Chocolatey_.  Follow
@@ -255,14 +257,14 @@ Configure button.  This pops up a dialog
 chose Visual Studio 14 2015.
 
 You need to configure some PCRE build options.  I chose to do build
-shared libs, to match newlines with the ``ANYCRLF`` option, and to do
-have UTF-8 support and support for Unicode properties.  When you're
-satisfied with the options, click on Generate.  Then in the build
-folder you've chosen, open the PCRE.sln file with Visual Studio, and
-build and install.  Make sure you set the Solution Configuration to
-Release if you want to build a releasable version of the MonetDB
-suite.  By default the library will be installed in ``C:\Program
-Files\PCRE``.
+shared libs, to match newlines with the ``ANYCRLF`` and
+``PCRE_SUPPORT_JIT`` options, and to do have UTF-8 support and support
+for Unicode properties.  When you're satisfied with the options, click
+on Generate.  Then in the build folder you've chosen, open the
+PCRE.sln file with Visual Studio, and build and install.  Make sure
+you set the Solution Configuration to Release if you want to build a
+releasable version of the MonetDB suite.  By default the library will
+be installed in ``C:\Program Files\PCRE``.
 
 For Windows64, select the correct compiler (``Visual 

MonetDB: gdk_tracer - Exception handling in GDKtracer & removed ...

2019-12-03 Thread Thodoris Zois
Changeset: 64e70976e111 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=64e70976e111
Modified Files:
gdk/gdk_tracer.c
Branch: gdk_tracer
Log Message:

Exception handling in GDKtracer & removed 2nd buffer


diffs (291 lines):

diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c
--- a/gdk/gdk_tracer.c
+++ b/gdk/gdk_tracer.c
@@ -41,16 +41,14 @@
 #endif
 
 static gdk_tracer tracer = { .allocated_size = 0, .id = 0 };
-static gdk_tracer secondary_tracer = { .allocated_size = 0, .id = 1 };
 static MT_Lock lock = MT_LOCK_INITIALIZER("GDKtracer");
-static ATOMIC_TYPE SELECTED_tracer_ID = 0;
 
 static FILE *output_file;
+static bool USE_STREAM = true;
+
 static ATOMIC_TYPE CUR_ADAPTER = DEFAULT_ADAPTER;
 
 static LOG_LEVEL CUR_FLUSH_LEVEL = DEFAULT_FLUSH_LEVEL;
-// LOG_LEVEL LVL_PER_COMPONENT[COMPONENTS_COUNT] = {[0 ... COMPONENTS_COUNT-1] 
= DEFAULT_LOG_LEVEL};
-
 static bool GDK_TRACER_STOP = false;
 
 static const char *LAYER_STR[] = {
@@ -66,34 +64,23 @@ LOG_LEVEL LVL_PER_COMPONENT[] = {
 };
 
 
-// Output error from snprintf of vsnprintf
-static void 
-_GDKtracer_log_output_error(int bytes_written)
-{
-assert(bytes_written >= 0);
-}
-
-
-static void 
-_GDKtracer_file_is_open(FILE *file)
-{
-assert(file);
-}
-
 
 // Prepares a file in order to write the contents of the buffer when necessary
-static void 
-_GDKtracer_create_file(void)
+static gdk_return
+_GDKtracer_init_basic_adptr(void)
 {
-char id[INT_MAX_LEN]; 
-snprintf(id, INT_MAX_LEN, "%d", 1);
-
 char file_name[FILENAME_MAX];
-sprintf(file_name, "%s%c%s%c%s%c%s%s", GDKgetenv("gdk_dbpath"), DIR_SEP, 
FILE_NAME, NAME_SEP, GDKtracer_get_timestamp("%Y-%m-%dT%H:%M:%S"), NAME_SEP, 
id, ".log");
+sprintf(file_name, "%s%c%s%c%s%s", GDKgetenv("gdk_dbpath"), DIR_SEP, 
FILE_NAME, NAME_SEP, GDKtracer_get_timestamp("%Y-%m-%dT%H:%M:%S"), ".log");
 
 output_file = fopen(file_name, "w");
 
-_GDKtracer_file_is_open(output_file);
+if(!output_file)
+{
+GDK_TRACER_REPORT_EXCEPTION("Failed to initialize BASIC adapter. Could 
not open file: %s\n", file_name);
+return GDK_FAIL;
+}
+
+return GDK_SUCCEED;
 }
 
 
@@ -165,9 +152,11 @@ static int
 if(fmt[fmt_len - 1] != NEW_LINE)
 {
 tmp = malloc(sizeof(char) * (fmt_len + 2));
-if(tmp == NULL)
+if(!tmp)
 {
-fprintf(stderr, "Memory allocation failed\n");
+// Let GDKtracer_log to know about the failure
+GDK_TRACER_REPORT_EXCEPTION("Memory allocation failed\n");
+return -1;
 }
 else
 {
@@ -189,7 +178,9 @@ static int
 if(tmp)
 free(tmp);
 
-_GDKtracer_log_output_error(bytes_written);
+// Let GDKtracer_log to know about the failure
+if(bytes_written < 0)
+return -1;
 
 // vsnprintf returned value -> does not include the null terminating 
character
 return bytes_written++;
@@ -269,8 +260,7 @@ GDKtracer_get_timestamp(char* fmt)
 gdk_return
 GDKtracer_init(void)
 {
-_GDKtracer_create_file();
-return GDK_SUCCEED;
+return _GDKtracer_init_basic_adptr();
 }
 
 
@@ -407,60 +397,45 @@ GDKtracer_log(LOG_LEVEL level, char *fmt
 {  
 gdk_tracer *fill_tracer;
 int bytes_written = 0;
-int GDK_result;
 
 MT_lock_set();
 {
-if((int) ATOMIC_GET(_tracer_ID) == tracer.id)
-fill_tracer = 
-else
-fill_tracer = _tracer;
+fill_tracer = 
 
 va_list va;
 va_start(va, fmt);
 bytes_written = _GDKtracer_fill_tracer(fill_tracer, fmt, va);
 va_end(va);
 
-// The message fits the buffer OR the buffer is empty (we don't care 
if it fits - just cut it off)
-if(bytes_written < (BUFFER_SIZE - fill_tracer->allocated_size) || 
-fill_tracer->allocated_size == 0)
+if(bytes_written < 0)
 {
-fill_tracer->allocated_size += bytes_written;
+GDK_TRACER_REPORT_EXCEPTION("Cannot write data to the buffer, 
discarding this entry\n");
+/* CHECK */
+// Maybe here add return GDK_FAIL?
 }
 else
 {
-/* CHECK */
-// Create thread for that
-// Flush the full tracer on a separate thread
-GDKtracer_flush_buffer();
-// MT_Id tid;
-// if(MT_create_thread(, (void(*) (void*)) 
GDKtracer_flush_buffer, NULL, MT_THR_JOINABLE, "GDKtracerFlush") < 0)
-// fprintf(stderr, "MT_create_thread FAILED!\n");
-// // return GDK_FAIL;
-// GDK_result = MT_join_thread(tid);
-// if(GDK_result == GDK_FAIL)
-// fprintf(stderr, "MT_join_thread FAILED!\n");
-// // return GDK_FAIL;
+// The message fits the buffer OR the buffer is empty but the 
message does not fit (we cut it off)
+if(bytes_written < 

MonetDB: gdk_tracer - Added VA args to GDK_TRACER_REPORT_EXCEPTI...

2019-12-03 Thread Thodoris Zois
Changeset: c6cdc624c280 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c6cdc624c280
Modified Files:
gdk/gdk_tracer.h
Branch: gdk_tracer
Log Message:

Added VA args to GDK_TRACER_REPORT_EXCEPTION macro


diffs (29 lines):

diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h
--- a/gdk/gdk_tracer.h
+++ b/gdk/gdk_tracer.h
@@ -219,7 +219,7 @@ extern LOG_LEVEL LVL_PER_COMPONENT[];
 ## __VA_ARGS__); \
 }\
 
-#define TRC_CRITICAL(COMP, MSG, ...) \
+#define TRC_CRITICAL(COMP, MSG, ...) \
 GDK_TRACER_LOG(M_CRITICAL, COMP, MSG, ## __VA_ARGS__)\
 
 #define TRC_ERROR(COMP, MSG, ...)\
@@ -250,13 +250,14 @@ gdk_tracer;
  * GDKtracer Stream Usage
  */
 // Exception
-#define GDK_TRACER_REPORT_EXCEPTION(MSG) \
+#define GDK_TRACER_REPORT_EXCEPTION(MSG, ...)\
 mnstr_printf(GDKstdout, "[%s] %s %s:%d M_CRITICAL GDK_TRACER %s # "MSG,  \
 GDKtracer_get_timestamp("%Y-%m-%d %H:%M:%S"),\
 __FILENAME__,\
 __FUNCTION__,\
 __LINE__,\
-MT_thread_getname());\
+MT_thread_getname(), \
+## __VA_ARGS__); \
 
 /*
  *  GDKtracer API
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - fixed crash in order_joins, in case of comple...

2019-12-03 Thread Niels Nes
Changeset: b42cd851c71a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b42cd851c71a
Modified Files:
sql/server/rel_optimizer.c
sql/test/mergetables/Tests/sqlsmith-exists.stable.out
Branch: default
Log Message:

fixed crash in order_joins, in case of complex multi relation join (or select) 
expressions


diffs (58 lines):

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
@@ -936,6 +936,11 @@ order_joins(mvc *sql, list *rels, list *
l = rn->data;
r = find_rel(rels, cje->l);
}
+   if (!r) {
+   fnd = 1; // not really, but this bails 
out
+   continue;
+   }
+
list_remove_data(rels, r);
append(n_rels, r);
 
diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out 
b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out
--- a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out
+++ b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out
@@ -131,6 +131,39 @@ stdout of test 'sqlsmith-exists` in dire
 % c0,  c1, c2, c3, c4, c5, c6, c7 # name
 % int, int,int,int,int,int,int,int # type
 % 1,   1,  1,  1,  1,  1,  1,  1 # length
+#CREATE TABLE integers(i INTEGER);
+#INSERT INTO integers VALUES (1), (2), (3), (NULL);
+[ 4]
+#CREATE TABLE tbl_ProductSales (ColID int, Product_Category  varchar(64), 
Product_Name  varchar(64), TotalSales int); 
+#INSERT INTO tbl_ProductSales VALUES (1,'Game','Mobo Game',200),(2,'Game','PKO 
Game',400),(3,'Fashion','Shirt',500),(4,'Fashion','Shorts',100);
+[ 4]
+#create table analytics (aa int, bb int, cc bigint);
+#insert into analytics values (15, 3, 15), (3, 1, 3), (2, 1, 2), (5, 3, 5), 
(NULL, 2, NULL), (3, 2, 3), (4, 1, 4), (6, 3, 6), (8, 2, 8), (NULL, 4, NULL);
+[ 10   ]
+#SELECT subq_1.c3 AS c0
+#FROM
+#  (SELECT 1 AS c0,
+#  subq_0.c8 AS c1,
+#  subq_0.c6 AS c2,
+#  subq_0.c0 AS c3,
+#  subq_0.c4 AS c4,
+#  subq_0.c9 AS c5,
+#  subq_0.c6 AS c6,
+#  subq_0.c0 AS c7,
+#  subq_0.c3 AS c8,
+#  subq_0.c4 AS c9,
+#  CASE
+#  WHEN (94 IS NOT NULL)
+#   OR (subq_0.c0 IS NULL) THEN subq_0.c4
+#  ELSE subq_0.c4
+#  END AS c10,
+#  subq_0.c5 AS c11,
+#  subq_0.c4 AS c12
+#   FROM
+% sys.subq_0 # table_name
+% c0 # name
+% int # type
+% 1 # length
 #ROLLBACK;
 
 # 19:56:32 >  
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: mosaic - Merge with default.

2019-12-03 Thread Aris Koning
Changeset: 5ea1d5700ef3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5ea1d5700ef3
Added Files:
debian/libmonetdb19.install
sql/backends/monet5/sql_subquery.c
sql/backends/monet5/sql_subquery.h
sql/backends/monet5/sql_subquery.mal
sql/benchmarks/arno/Tests/inserts.options5
sql/benchmarks/arno/Tests/inserts.reqtests
sql/benchmarks/arno/Tests/inserts.sql.src
sql/benchmarks/arno/Tests/inserts.stable.err
sql/benchmarks/arno/Tests/inserts.stable.out
sql/benchmarks/arno/inserts.sql
sql/benchmarks/arno_flt/inserts.flt.sql
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.SQL.bat
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.SQL.sh
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.stable.err
sql/jdbc/tests/Tests/Bug_PrepStmt_With_Errors_Jira292.stable.out
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.sql
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.err
sql/test/BugTracker-2014/Tests/aggregates-intervals.Bug-3533.stable.out
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.err
sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.stable.out
sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.sql
sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.err
sql/test/BugTracker-2019/Tests/count-distinct.Bug-6790.stable.out
sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.stable.err
sql/test/BugTracker-2019/Tests/grant-select-column.Bug-6765.stable.out
sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.sql
sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.err
sql/test/BugTracker-2019/Tests/jsonpath-validity.Bug-6792.stable.out

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.sql

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.err

sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.out

sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.stable.out
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.sql
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.stable.err
sql/test/BugTracker-2019/Tests/str_to_time.Bug-6791.stable.out
sql/test/Tests/fsum1.stable.out
sql/test/analytics/Tests/analytics10.sql
sql/test/analytics/Tests/analytics10.stable.err
sql/test/analytics/Tests/analytics10.stable.out
sql/test/analytics/Tests/analytics11.sql
sql/test/analytics/Tests/analytics11.stable.err
sql/test/analytics/Tests/analytics11.stable.out
sql/test/analytics/Tests/analytics12.sql
sql/test/analytics/Tests/analytics12.stable.err
sql/test/analytics/Tests/analytics12.stable.out
sql/test/analytics/Tests/analytics13.sql
sql/test/analytics/Tests/analytics13.stable.err
sql/test/analytics/Tests/analytics13.stable.out
sql/test/mapi/Tests/utf8test.stable.out.Windows
sql/test/mergetables/Tests/sqlsmith-exists.stable.err
sql/test/mergetables/Tests/sqlsmith-exists.stable.out
sql/test/scanner/Tests/All
sql/test/scanner/Tests/raw_strings.sql
sql/test/scanner/Tests/raw_strings.stable.err
sql/test/scanner/Tests/raw_strings.stable.out
Removed Files:
ChangeLog.Apr2019
buildtools/ChangeLog.Apr2019
buildtools/selinux/ChangeLog.Apr2019
clients/ChangeLog.Apr2019
clients/mapilib/ChangeLog.Apr2019
common/stream/ChangeLog.Apr2019
debian/libmonetdb18.install
gdk/ChangeLog.Apr2019
geom/ChangeLog.Apr2019
monetdb5/ChangeLog.Apr2019
sql/ChangeLog.Apr2019
sql/benchmarks/arno/Tests/insert_ATOM.options5
sql/benchmarks/arno/Tests/insert_ATOM.reqtests
sql/benchmarks/arno/Tests/insert_ATOM.sql.src
sql/benchmarks/arno/Tests/insert_ATOM.stable.err
sql/benchmarks/arno/Tests/insert_ATOM.stable.out
sql/benchmarks/arno/Tests/insert_BOND.options5
sql/benchmarks/arno/Tests/insert_BOND.reqtests
sql/benchmarks/arno/Tests/insert_BOND.sql.src
sql/benchmarks/arno/Tests/insert_BOND.stable.err
sql/benchmarks/arno/Tests/insert_BOND.stable.out
sql/benchmarks/arno/Tests/insert_MODEL.reqtests
sql/benchmarks/arno/Tests/insert_MODEL.sql.src
sql/benchmarks/arno/Tests/insert_MODEL.stable.err
sql/benchmarks/arno/Tests/insert_MODEL.stable.out
sql/benchmarks/arno/insert_ATOM.int.sql
sql/benchmarks/arno/insert_BOND.int.sql
sql/benchmarks/arno/insert_MODEL.int.sql
sql/benchmarks/arno_flt/insert_ATOM.flt.sql
sql/benchmarks/arno_flt/insert_BOND.flt.sql

MonetDB: mosaic - Update TODO's.

2019-12-03 Thread Aris Koning
Changeset: 870983ea9c3c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=870983ea9c3c
Modified Files:
monetdb5/modules/mosaic/TODO_MOSAIC.txt
Branch: mosaic
Log Message:

Update TODO's.


diffs (40 lines):

diff --git a/monetdb5/modules/mosaic/TODO_MOSAIC.txt 
b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
--- a/monetdb5/modules/mosaic/TODO_MOSAIC.txt
+++ b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
@@ -6,29 +6,29 @@ Create test for swapped join.
 Add lots of tests with candidate lists for all
 Add test for float/double
 Add test for huge
-Introduce mosaic into gdk: create hooks in scanselect functions/macro's, joins 
and projections.
-Apply compressed operations more directly: on keys in dictionary compression 
(1)
-Apply compressed operations more directly: on prefix|suffix in prefix 
compression (1)
-Apply compressed operations more directly: on delta's and frame in frame 
compression (1)
+Add test for default join and COUI case both in MAL and in SQL.
 Be sure alignment is correct. Use asserts for this.
 Check MOSanalysis and its test.
 Fix/check/test MOSlayout.
+Introduce mosaic into gdk: create hooks in scanselect functions/macro's, joins 
and projections.
 benchmark using TPC-H
 make mitosis work with mosaic and see how this relates to the previous 
landmark stuff.
+Apply compressed operations more directly: on keys in dictionary compression 
(1)
+Apply compressed operations more directly: on prefix|suffix in prefix 
compression (1)
+Apply compressed operations more directly: on delta's and frame in frame 
compression (1)
 consider packing mosaic_block_header's more efficiently.
 Add asserts on type degeneration for bit => bte daytime => lng timestmap => 
lng date => int.
 DO nil checking more efficient similar to gdk_select
+Timing in the context of MOSanalysis
 
 code issues
+See if the iteration algorithms can be improved.
 Get rid of (most of) MOStask and/or don't allocate it on the heap.
 Make sure the parameters.bits fields are always char.
 Use GDK naming conventions, e.g. o for stuff coming out if canditer_next.
 Make block headers specific by having type parametrized blockheader struct's.
 atomic base type of an oid bat is lng. So we can remove that one.
 It is a bit cleaner if MOSadvance call's are done outside of select functions.
-Refactor frame compressions code to be more inline with the other compression 
algortihm code.(1)
 create a common header/source file for mosaic for common tasks e.g. to house a 
generic IS_NIL macro, IPtpe, etc.
-mosaic_.c: for type macro's use macro-wised inline functions. (1)
-Factor out more boilerplate code in various compression techniques. All 
compression follow similar patterns. (1*)
 Improve the administration of the various hard coded compression techniques, 
e.g. MOSskipit skip (2*)
 Update copyright in 2020.
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: mosaic - Create type-specific versions of MOSadvance_*.

2019-12-03 Thread Aris Koning
Changeset: 6b7e79475873 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b7e79475873
Modified Files:
monetdb5/modules/mosaic/TODO_MOSAIC.txt
monetdb5/modules/mosaic/mosaic_capped.c
monetdb5/modules/mosaic/mosaic_delta.c
monetdb5/modules/mosaic/mosaic_delta.h
monetdb5/modules/mosaic/mosaic_dictionary.h
monetdb5/modules/mosaic/mosaic_frame.c
monetdb5/modules/mosaic/mosaic_frame.h
monetdb5/modules/mosaic/mosaic_join.h
monetdb5/modules/mosaic/mosaic_linear.c
monetdb5/modules/mosaic/mosaic_linear.h
monetdb5/modules/mosaic/mosaic_prefix.c
monetdb5/modules/mosaic/mosaic_prefix.h
monetdb5/modules/mosaic/mosaic_projection.h
monetdb5/modules/mosaic/mosaic_raw.c
monetdb5/modules/mosaic/mosaic_raw.h
monetdb5/modules/mosaic/mosaic_runlength.c
monetdb5/modules/mosaic/mosaic_runlength.h
monetdb5/modules/mosaic/mosaic_select.h
monetdb5/modules/mosaic/mosaic_utility.h
monetdb5/modules/mosaic/mosaic_var.c
Branch: mosaic
Log Message:

Create type-specific versions of MOSadvance_*.


diffs (truncated from 579 to 300 lines):

diff --git a/monetdb5/modules/mosaic/TODO_MOSAIC.txt 
b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
--- a/monetdb5/modules/mosaic/TODO_MOSAIC.txt
+++ b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
@@ -1,6 +1,6 @@
 technical depth
-Split the MOSadvance-like functions to type specific variant and remove the 
MOSskip functions.
-See if decompress can be refactored similar to the algebraic operators.
+Split the MOSadvance-like functions to type specific variant.
+See if compress, decompress and layout can be refactored similar to the 
algebraic operators.
 Factor out boilerplate code mosaic code: resulting mosaic boilerplate is for 
testing purposes.
 Create test for swapped join.
 Add lots of tests with candidate lists for all
diff --git a/monetdb5/modules/mosaic/mosaic_capped.c 
b/monetdb5/modules/mosaic/mosaic_capped.c
--- a/monetdb5/modules/mosaic/mosaic_capped.c
+++ b/monetdb5/modules/mosaic/mosaic_capped.c
@@ -111,17 +111,34 @@ DictionaryClass(hge)
 #define GetTypeWidth(INFO) ((INFO)->dict->twidth)
 #define GetSizeInBytes(INFO)   (BATcount((INFO)->dict) * 
GetTypeWidth(INFO))
 
+#define MOSadvance_DEF(TPE)\
+MOSadvance_SIGNATURE(capped, TPE) advance_dictionary(capped)
+
+MOSadvance_DEF(bte)
+MOSadvance_DEF(sht)
+MOSadvance_DEF(int)
+MOSadvance_DEF(lng)
+MOSadvance_DEF(flt)
+MOSadvance_DEF(dbl)
+#ifdef HAVE_HGE
+MOSadvance_DEF(hge)
+#endif
+
 void
 MOSadvance_capped(MOStask task)
 {
-   int *dst = (int*)  MOScodevectorDict(task);
-   BUN cnt = MOSgetCnt(task->blk);
-   BUN bytes;
-
-   assert(cnt > 0);
-   task->start += (oid) cnt;
-   bytes =  (cnt * GET_FINAL_BITS(task, capped))/8 + (((cnt * 
GET_FINAL_BITS(task, capped)) %8) != 0);
-   task->blk = (MosaicBlk) (((char*) dst)  + wordaligned(bytes, 
BitVectorChunk));
+   // TODO: Not strictly necessary to split on type here since the logic 
remains the same.
+   switch(ATOMbasetype(task->type)){
+   case TYPE_bte: MOSadvance_capped_bte(task); break;
+   case TYPE_sht: MOSadvance_capped_sht(task); break;
+   case TYPE_int: MOSadvance_capped_int(task); break;
+   case TYPE_lng: MOSadvance_capped_lng(task); break;
+   case TYPE_flt: MOSadvance_capped_flt(task); break;
+   case TYPE_dbl: MOSadvance_capped_dbl(task); break;
+#ifdef HAVE_HGE
+   case TYPE_hge: MOSadvance_capped_hge(task); break;
+#endif
+   }
 }
 
 void
diff --git a/monetdb5/modules/mosaic/mosaic_delta.c 
b/monetdb5/modules/mosaic/mosaic_delta.c
--- a/monetdb5/modules/mosaic/mosaic_delta.c
+++ b/monetdb5/modules/mosaic/mosaic_delta.c
@@ -40,20 +40,42 @@ bool MOStypes_delta(BAT* b) {
 }
 #define toEndOfBitVector(CNT, BITS) wordaligned(((CNT) * (BITS) / CHAR_BIT) + 
( ((CNT) * (BITS)) % CHAR_BIT != 0 ), BitVectorChunk)
 
+#define MOSadvance_DEF(TPE)\
+MOSadvance_SIGNATURE(delta, TPE)\
+{\
+   MosaicBlkHeader_delta_t* parameters = (MosaicBlkHeader_delta_t*) 
(task)->blk;\
+   int *dst = (int*)  (((char*) task->blk) + 
wordaligned(sizeof(MosaicBlkHeader_delta_t), BitVectorChunk));\
+   long cnt = parameters->base.cnt;\
+   long bytes = toEndOfBitVector(cnt, parameters->bits);\
+\
+   assert(cnt > 0);\
+   task->start += (oid) cnt;\
+   task->blk = (MosaicBlk) (((char*) dst)  + bytes);\
+}
+
+MOSadvance_DEF(bte)
+MOSadvance_DEF(sht)
+MOSadvance_DEF(int)
+MOSadvance_DEF(lng)
+#ifdef HAVE_HGE
+MOSadvance_DEF(hge)
+#endif
+
 void
 MOSadvance_delta(MOStask task)
 {
-   MosaicBlkHeader_delta_t* parameters = (MosaicBlkHeader_delta_t*) 
(task)->blk;
-   int *dst = (int*)  (((char*) task->blk) + 
wordaligned(sizeof(MosaicBlkHeader_delta_t), BitVectorChunk));
-   long cnt = parameters->base.cnt;
-   long bytes = toEndOfBitVector(cnt, parameters->bits);
-
-   assert(cnt > 0);
-   

MonetDB: mosaic - Add missing test files.

2019-12-03 Thread Aris Koning
Changeset: 6264e0e23a6d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6264e0e23a6d
Added Files:
sql/test/mosaic/Tests/join.options5
sql/test/mosaic/Tests/join.sql
sql/test/mosaic/Tests/join.stable.err
sql/test/mosaic/Tests/join.stable.out
Branch: mosaic
Log Message:

Add missing test files.


diffs (truncated from 12581 to 300 lines):

diff --git a/sql/test/mosaic/Tests/join.options5 
b/sql/test/mosaic/Tests/join.options5
new file mode 100644
--- /dev/null
+++ b/sql/test/mosaic/Tests/join.options5
@@ -0,0 +1,1 @@
+--debug=2097152
diff --git a/sql/test/mosaic/Tests/join.sql b/sql/test/mosaic/Tests/join.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/mosaic/Tests/join.sql
@@ -0,0 +1,58 @@
+START TRANSACTION;
+
+set optimizer='mosaic_pipe';
+
+create table tmp3( i int, b boolean, f real,t timestamp);
+insert into tmp3 values
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(2, false, 0.314,'2014-08-23 11:34:54.00'),
+(3, true, 0.314,'2014-08-23 11:34:54.00'),
+(2, false, 0.314,'2014-08-23 11:34:54.00'),
+(3, true, 0.314,'2014-08-23 11:34:54.00'),
+(2, false, 0.314,'2014-08-23 11:34:54.00'),
+(3, true, 0.314,'2014-08-23 11:34:54.00'),
+(4, true, 0.316,'2014-08-23 11:34:54.00'),
+(4, true, 0.316,'2014-08-23 11:34:54.00'),
+(4, false, 0.316,'2014-08-23 11:34:54.00'),
+(0, false, 0.316,'2014-08-23 11:34:54.00'),
+(5, false, 0.317,'2014-08-23 11:34:54.00'),
+(6, false, 0.317,'2014-08-23 11:34:54.00'),
+(7, false, 0.317,'2014-08-23 11:34:54.00'),
+(8, false, 0.317,'2014-08-23 11:34:54.00'),
+(9, false, 0.317,'2014-08-23 11:34:54.00');
+
+
+alter table tmp3 set read only;
+
+alter table tmp3 alter column i set storage 'delta';
+
+create table tmp4( i int, b boolean, f real,t timestamp);
+insert into tmp4 values
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(3, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(4, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(5, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00'),
+(1, true, 0.314,'2014-08-23 11:34:54.00');
+
+explain select tmp3.i, tmp4.i from tmp3, tmp4 where tmp3.i = tmp4.i;
+select tmp3.i, tmp4.i from tmp3, tmp4 where tmp3.i = tmp4.i;
+
+set optimizer = 'mosaiccoui_pipe';
+
+explain select tmp3.i, tmp4.i from tmp3, tmp4 where tmp3.i = tmp4.i;
+select tmp3.i, tmp4.i from tmp3, tmp4 where tmp3.i = tmp4.i;
+
+ROLLBACK;
diff --git a/sql/test/mosaic/Tests/join.stable.err 
b/sql/test/mosaic/Tests/join.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/mosaic/Tests/join.stable.err
@@ -0,0 +1,12191 @@
+stderr of test 'join` in directory 'sql/test/mosaic` itself:
+
+
+# 13:25:01 >  
+# 13:25:01 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32105" "--set" 
"mapi_usock=/var/tmp/mtest-27046/.s.monetdb.32105" "--forcemito" 
"--dbpath=/home/aris/sources/monetdb/build/installation/var/MonetDB/mTests_sql_test_mosaic"
 "--debug=2097152" "--set" "embedded_c=true"
+# 13:25:01 >  
+
+# builtin opt  gdk_dbpath = 
/home/aris/sources/monetdb/build/installation/var/monetdb5/dbfarm/demo
+# builtin opt  mapi_port = 5
+# builtin opt  mapi_open = false
+# builtin opt  mapi_ipv6 = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 32105
+# cmdline opt  mapi_usock = /var/tmp/mtest-27046/.s.monetdb.32105
+# cmdline opt  gdk_dbpath = 
/home/aris/sources/monetdb/build/installation/var/MonetDB/mTests_sql_test_mosaic
+# cmdline opt  embedded_c = true
+#COLnew()=tmp_21#0@0[str]TSRN
+#COLnew()=tmp_313#0@0[str]TSRN
+#BAThash: create hash(environment_key#10@0[str]TN);
+#HASHnew: create hash(size 256, mask 256, width 2, total 1024 bytes);
+#BAThash: hash construction 19 usec
+#BAThash: statistics (10, entries 9, mask 255, max 2, avg 1.11);
+#BAThash: NOT persisting hash 17
+#BATcheckhash: already has hash environment_key, waited 0 usec
+#BATcheckhash: already has hash environment_key, waited 0 usec
+#BATcheckhash: already has hash environment_key, waited 0 usec
+#BATcheckhash: already has hash environment_key, waited 0 usec
+#BATcheckhash: already has hash environment_key, waited 0 usec
+#BATcheckhash: already has hash environment_key, waited 0 

MonetDB: mosaic - Get rid of MOSskip_* functions.

2019-12-03 Thread Aris Koning
Changeset: 4497e5d2028e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4497e5d2028e
Modified Files:
clients/Tests/exports.stable.out
clients/Tests/mclient-uri.stable.out
monetdb5/modules/mosaic/mosaic.c
monetdb5/modules/mosaic/mosaic.h
monetdb5/modules/mosaic/mosaic_capped.c
monetdb5/modules/mosaic/mosaic_capped.h
monetdb5/modules/mosaic/mosaic_delta.c
monetdb5/modules/mosaic/mosaic_delta.h
monetdb5/modules/mosaic/mosaic_dictionary.h
monetdb5/modules/mosaic/mosaic_frame.c
monetdb5/modules/mosaic/mosaic_frame.h
monetdb5/modules/mosaic/mosaic_join.h
monetdb5/modules/mosaic/mosaic_linear.c
monetdb5/modules/mosaic/mosaic_linear.h
monetdb5/modules/mosaic/mosaic_prefix.c
monetdb5/modules/mosaic/mosaic_prefix.h
monetdb5/modules/mosaic/mosaic_projection.h
monetdb5/modules/mosaic/mosaic_raw.c
monetdb5/modules/mosaic/mosaic_raw.h
monetdb5/modules/mosaic/mosaic_runlength.c
monetdb5/modules/mosaic/mosaic_runlength.h
monetdb5/modules/mosaic/mosaic_select.h
monetdb5/modules/mosaic/mosaic_var.c
monetdb5/modules/mosaic/mosaic_var.h
Branch: mosaic
Log Message:

Get rid of MOSskip_* functions.


diffs (truncated from 527 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1574,14 +1574,6 @@ str MOSprepareEstimate_capped(MOStask ta
 str MOSprepareEstimate_var(MOStask task);
 str MOSprojection(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str MOSselect(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-void MOSskip_capped(MOStask task);
-void MOSskip_delta(MOStask task);
-void MOSskip_frame(MOStask task);
-void MOSskip_linear(MOStask task);
-void MOSskip_prefix(MOStask task);
-void MOSskip_raw(MOStask task);
-void MOSskip_runlength(MOStask task);
-void MOSskip_var(MOStask task);
 str MOSslice(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str MOSsliceInternal(bat *slices, BUN size, BAT *b);
 str MOSthetaselect(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
diff --git a/clients/Tests/mclient-uri.stable.out 
b/clients/Tests/mclient-uri.stable.out
--- a/clients/Tests/mclient-uri.stable.out
+++ b/clients/Tests/mclient-uri.stable.out
@@ -1,50 +1,2 @@
 stdout of test 'mclient-uri` in directory 'clients` itself:
 
-
-# 10:30:50 >  
-# 10:30:50 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36840" "--set" 
"mapi_usock=/var/tmp/mtest-2769/.s.monetdb.36840" "--set" "monet_prompt=" 
"--forcemito" "--dbpath=/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_clients"
-# 10:30:50 >  
-
-# MonetDB 5 server v11.25.22 (hg id: 7b4a32dfbcc5+)
-# This is an unreleased version
-# Serving database 'mTests_clients', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
-# Found 15.589 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://madrid.da.cwi.nl:36840/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-2769/.s.monetdb.36840
-# MonetDB/GIS module loaded
-# MonetDB/SQL module loaded
-
-
-# 10:30:51 >  
-# 10:30:51 >  "./mclient-uri.SQL.sh" "mclient-uri"
-# 10:30:51 >  
-
-
-# 10:30:51 >  
-# 10:30:51 >  mclient -d 
mapi:monetdb://madrid:36840/mTests_clients?language=sql=monetdb -f test -E 
utf-8 -s select 1
-# 10:30:51 >  
-
-% .L2 # table_name
-% L2 # name
-% tinyint # type
-% 1 # length
-[ 1]
-
-# 10:30:51 >  
-# 10:30:51 >  mclient -d 
mapi:monetdb:///var/tmp/mtest-2769/.s.monetdb.36840?database=mTests_clients=sql=monetdb
 -f test -E utf-8 -s select 1
-# 10:30:51 >  
-
-% .L2 # table_name
-% L2 # name
-% tinyint # type
-% 1 # length
-[ 1]
-
-# 10:30:51 >  
-# 10:30:51 >  "Done."
-# 10:30:51 >  
-
diff --git a/monetdb5/modules/mosaic/mosaic.c b/monetdb5/modules/mosaic/mosaic.c
--- a/monetdb5/modules/mosaic/mosaic.c
+++ b/monetdb5/modules/mosaic/mosaic.c
@@ -642,47 +642,47 @@ MOSdecompressInternal(BAT** res, BAT* bs
 
task->timer = GDKusec();
 
-   while(task->blk){
+   while(MOSgetTag(task->blk) != MOSAIC_EOL){
switch(MOSgetTag(task->blk)){
case MOSAIC_RAW:
ALGODEBUG mnstr_printf(GDKstdout, 
"MOSdecompress_raw\n");
MOSdecompress_raw(task);
-   MOSskip_raw(task);
+   MOSadvance_raw(task);
break;
case MOSAIC_RLE:
ALGODEBUG mnstr_printf(GDKstdout, 
"MOSdecompress_runlength\n");
MOSdecompress_runlength(task);
-   

MonetDB: mosaic - Make two versions of mosaic (nested loop) join...

2019-12-03 Thread Aris Koning
Changeset: 831629adcb15 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=831629adcb15
Modified Files:
monetdb5/modules/mosaic/TODO_MOSAIC.txt
monetdb5/modules/mosaic/mosaic_join.h
monetdb5/optimizer/opt_mosaic.c
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_wrapper.c
monetdb5/optimizer/optimizer.mal
sql/test/mosaic/Tests/All
Branch: mosaic
Log Message:

Make two versions of mosaic (nested loop) join available.


diffs (234 lines):

diff --git a/monetdb5/modules/mosaic/TODO_MOSAIC.txt 
b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
--- a/monetdb5/modules/mosaic/TODO_MOSAIC.txt
+++ b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
@@ -1,6 +1,4 @@
 technical depth
-Create an 
uncompressed-bat-on-the-outer-side-and-compressed-bat-on-the-inner-side-nested-loop-join
 and mark it as default mosaic.join.
-Make the COUI-nested-loop-join available for comparison. i.e. separate 
optimizer.
 Split the MOSadvance-like functions to type specific variant and remove the 
MOSskip functions.
 See if decompress can be refactored similar to the algebraic operators.
 Factor out boilerplate code mosaic code: resulting mosaic boilerplate is for 
testing purposes.
diff --git a/monetdb5/modules/mosaic/mosaic_join.h 
b/monetdb5/modules/mosaic/mosaic_join.h
--- a/monetdb5/modules/mosaic/mosaic_join.h
+++ b/monetdb5/modules/mosaic/mosaic_join.h
@@ -110,35 +110,35 @@ static str MOSjoin_COUI_##TPE(MOStask ta
 \
switch(MOSgetTag(task->blk)){\
case MOSAIC_RLE:\
-   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_runlength\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_runlength\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, runlength, TPE);\
break;\
case MOSAIC_CAPPED:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_capped\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_capped\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, capped, TPE);\
break;\
case MOSAIC_VAR:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_var\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_var\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, var, TPE);\
break;\
case MOSAIC_FRAME:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_frame\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_frame\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, frame, TPE);\
break;\
case MOSAIC_DELTA:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_delta\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_delta\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, delta, TPE);\
break;\
case MOSAIC_PREFIX:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_prefix\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_prefix\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, prefix, TPE);\
break;\
case MOSAIC_LINEAR:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_linear\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_linear\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, linear, TPE);\
break;\
case MOSAIC_RAW:\
-   ALGODEBUG mnstr_printf(GDKstdout, "MOSjoin_raw\n");\
+   ALGODEBUG mnstr_printf(GDKstdout, 
"MOSjoin_COUI_raw\n");\
DO_OPERATION_IF_ALLOWED(join_COUI, raw, TPE);\
break;\
}\
diff --git a/monetdb5/optimizer/opt_mosaic.c b/monetdb5/optimizer/opt_mosaic.c
--- a/monetdb5/optimizer/opt_mosaic.c
+++ b/monetdb5/optimizer/opt_mosaic.c
@@ -46,8 +46,8 @@ static int OPTmosaicType(MalBlkPtr mb, I
return 0;
 }
 
-str 
-OPTmosaicImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci)
+static str
+OPTmosaicImplementationInternal(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci, bool coui)
 {
InstrPtr p,q, *old;
 int limit, slimit,i,j, k, actions =0;
@@ -55,7 +55,7 @@ OPTmosaicImplementation(Client cntxt, Ma
char buf[256];
 lng usec = GDKusec();
 
-   if( optimizerIsApplied(mb,"mosaic"))
+   if( optimizerIsApplied(mb,"mosaic") || 
optimizerIsApplied(mb,"mosaiccoui"))
return MAL_SUCCEED;
check = GDKzalloc(mb->vsize);
if ( check == NULL)
@@ -74,8 +74,8 @@ OPTmosaicImplementation(Client cntxt, Ma
}
 
(void) cntxt;
+   

MonetDB: mosaic - Improve mosaic optimizer and mosaic projection:

2019-12-03 Thread Aris Koning
Changeset: b08fa89e6cfd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b08fa89e6cfd
Modified Files:
monetdb5/modules/mosaic/Tests/mosaic_date_1.capped.stable.out
monetdb5/modules/mosaic/Tests/mosaic_date_1.delta.stable.out
monetdb5/modules/mosaic/Tests/mosaic_date_1.frame.stable.out
monetdb5/modules/mosaic/Tests/mosaic_date_1.prefix.stable.out
monetdb5/modules/mosaic/Tests/mosaic_date_1.raw.stable.out
monetdb5/modules/mosaic/Tests/mosaic_date_1.var.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_1.capped.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_1.delta.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_1.frame.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_1.prefix.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_1.raw.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_1.var.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_2.linear.stable.out
monetdb5/modules/mosaic/Tests/mosaic_lng_2.runlength.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_1.capped.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_1.delta.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_1.frame.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_1.prefix.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_1.raw.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_1.var.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_2.linear.stable.out
monetdb5/modules/mosaic/Tests/mosaic_oid_2.runlength.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_1.capped.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_1.frame.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_1.prefix.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_1.raw.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_1.var.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_2.linear.stable.out
monetdb5/modules/mosaic/Tests/mosaic_timestamp_2.runlength.stable.out
monetdb5/modules/mosaic/mosaic.c
monetdb5/optimizer/opt_mosaic.c
Branch: mosaic
Log Message:

Improve mosaic optimizer and mosaic projection:
- mosaic.projection returns the left side if the right side is a fully covering 
candidate list.
- mosaic optimizer always replaces join, (theta)select and projection.


diffs (truncated from 548 to 300 lines):

diff --git a/monetdb5/modules/mosaic/Tests/mosaic_date_1.capped.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_date_1.capped.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_date_1.capped.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_date_1.capped.stable.out
@@ -221,8 +221,6 @@ MOSjoin_capped
 MOSjoin_capped
 MOSjoin_capped
 MOSselect_capped
-MOSprojection_capped
-MOSprojection_capped
 
 # 16:33:17 >  
 # 16:33:17 >  "/usr/bin/python3" "mosaic_date_1.capped.MAL.py" 
"mosaic_date_1.capped"
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_date_1.delta.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_date_1.delta.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_date_1.delta.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_date_1.delta.stable.out
@@ -221,8 +221,6 @@ MOSjoin_delta
 MOSjoin_delta
 MOSjoin_delta
 MOSselect_delta
-MOSprojection_delta
-MOSprojection_delta
 
 # 16:33:20 >  
 # 16:33:20 >  "/usr/bin/python3" "mosaic_date_1.delta.MAL.py" 
"mosaic_date_1.delta"
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_date_1.frame.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_date_1.frame.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_date_1.frame.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_date_1.frame.stable.out
@@ -221,8 +221,6 @@ MOSjoin_frame
 MOSjoin_frame
 MOSjoin_frame
 MOSselect_frame
-MOSprojection_frame
-MOSprojection_frame
 
 # 16:33:28 >  
 # 16:33:28 >  "/usr/bin/python3" "mosaic_date_1.frame.MAL.py" 
"mosaic_date_1.frame"
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_date_1.prefix.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_date_1.prefix.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_date_1.prefix.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_date_1.prefix.stable.out
@@ -221,8 +221,6 @@ MOSjoin_prefix
 MOSjoin_prefix
 MOSjoin_prefix
 MOSselect_prefix
-MOSprojection_prefix
-MOSprojection_prefix
 
 # 16:33:31 >  
 # 16:33:31 >  "/usr/bin/python3" "mosaic_date_1.prefix.MAL.py" 
"mosaic_date_1.prefix"
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_date_1.raw.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_date_1.raw.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_date_1.raw.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_date_1.raw.stable.out
@@ -221,8 +221,6 @@ MOSjoin_raw
 MOSjoin_raw
 MOSjoin_raw
 MOSselect_raw
-MOSprojection_raw
-MOSprojection_raw
 
 # 16:33:04 >  
 # 16:33:04 >  "/usr/bin/python3" "mosaic_date_1.raw.MAL.py" 

MonetDB: mosaic - Mosaic does not support string type.

2019-12-03 Thread Aris Koning
Changeset: 91ecbf0a364f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=91ecbf0a364f
Modified Files:
monetdb5/optimizer/opt_mosaic.c
Branch: mosaic
Log Message:

Mosaic does not support string type.


diffs (11 lines):

diff --git a/monetdb5/optimizer/opt_mosaic.c b/monetdb5/optimizer/opt_mosaic.c
--- a/monetdb5/optimizer/opt_mosaic.c
+++ b/monetdb5/optimizer/opt_mosaic.c
@@ -33,7 +33,6 @@ static int OPTmosaicType(MalBlkPtr mb, I
case TYPE_oid:
case TYPE_flt:
case TYPE_dbl:
-   case TYPE_str:
return 1;
default:
if( type == TYPE_date)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


monetdb-ruby: default - Further improvement, parse header string...

2019-12-03 Thread Pedro Ferreira
Changeset: 8bf57d01c887 for monetdb-ruby
URL: https://dev.monetdb.org/hg/monetdb-ruby?cmd=changeset;node=8bf57d01c887
Modified Files:
lib/MonetDBData.rb
Branch: default
Log Message:

Further improvement, parse header strings between double quotes and with spaces


diffs (103 lines):

diff --git a/lib/MonetDBData.rb b/lib/MonetDBData.rb
--- a/lib/MonetDBData.rb
+++ b/lib/MonetDBData.rb
@@ -297,43 +297,77 @@ class MonetDBData
 return header.freeze
   end
   
+  # Parse escaped strings between double quotes
+  def parse_header_table_values(line, start, stop, results)
+i = start
+inString = false
+escaped = false
+
+until i == stop do
+  case line[i]
+when '\\'
+  escaped = !escaped
+when '"'
+  if !inString
+inString = true
+  else
+inString = false
+  end 
+  escaped = false
+when ','
+  if !inString # && line[i + 1] == '\t'
+if line[start] == '"' # Don't include the leading " in the column 
atribute
+  start += 1
+end
+if line[i - 1] == '"'
+  next_end = 2
+else
+  next_end = 1
+end
+results.push(line[start..i - next_end])
+i += 1
+start = i + 1
+  end
+  escaped = false
+else
+  escaped = false
+  end
+  i += 1
+end
+if line[start] == '"' # Don't include the leading " in the column atribute
+  start += 1
+end
+if line[stop] == '"'
+  next_end = 1
+else
+  next_end = 0
+end
+results.push(line[start..stop - next_end])
+  end
+  
   # Parses a Q_TABLE header and returns information about the schema.
   def parse_header_table(header_t)
 if @query["type"] == MonetDBConnection::Q_TABLE
   if header_t != nil
   
-name_t = header_t[0][2..-15].split(' ') # remove # table_name
-name_t.each_with_index do |col, i|
-if i != name_t.length - 1
-  name_t[i] = col[0..-2] # remove trailing comma
-end
-end
+name_t = Array.new
+parse_header_table_values(header_t[0], 2, header_t[0].length - 15, 
name_t)
   
-name_cols = header_t[1][2..-9].split(' ') # remove # name
-name_cols.each_with_index do |col, i|
-if i != name_cols.length - 1
-  name_cols[i] = col[0..-2] # remove trailing comma
-end
-end
+name_cols = Array.new
+parse_header_table_values(header_t[1], 2, header_t[1].length - 9, 
name_cols)
   
 type_cols = { }
-type_cols_array = header_t[2][2..-9].split(' ') # remove # type
+type_cols_array = Array.new
+parse_header_table_values(header_t[2], 2, header_t[2].length - 9, 
type_cols_array)
 type_cols_array.each_with_index do |col, i|
-if i != type_cols_array.length - 1
-  type_cols[name_cols[i]] = col[0..-2] # remove trailing comma
-else
   type_cols[name_cols[i]] = col
-end
 end
   
 length_cols = { }
-length_cols_array = header_t[3][2..-11].split(' ') # remove # length
+length_cols_array = Array.new
+parse_header_table_values(header_t[3], 2, header_t[3].length - 11, 
length_cols_array)
 length_cols_array.each_with_index do |col, i|
-if i != length_cols_array.length - 1
-  length_cols[name_cols[i]] = col[0..-2] # remove trailing comma
-else
   length_cols[name_cols[i]] = col
-end
 end
   
 columns_order = {}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-12-03 Thread Sjoerd Mullender
Changeset: bc3e06a3a647 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc3e06a3a647
Modified Files:
gdk/gdk_batop.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (11 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -865,6 +865,7 @@ BATreplace(BAT *b, BAT *p, BAT *n, bool 
 
b->tsorted = b->trevsorted = false;
b->tnosorted = b->tnorevsorted = 0;
+   b->tseqbase = oid_nil;
b->tkey = false;
b->tnokey[0] = b->tnokey[1] = 0;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - One more property to squash.

2019-12-03 Thread Sjoerd Mullender
Changeset: a7c289e8f33c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7c289e8f33c
Modified Files:
gdk/gdk_batop.c
Branch: Nov2019
Log Message:

One more property to squash.


diffs (11 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -960,6 +960,7 @@ BATreplace(BAT *b, BAT *p, BAT *n, bool 
 
b->tsorted = b->trevsorted = false;
b->tnosorted = b->tnorevsorted = 0;
+   b->tseqbase = oid_nil;
b->tkey = false;
b->tnokey[0] = b->tnokey[1] = 0;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: gdk_tracer - Fix - compilation issue on macOS only

2019-12-03 Thread Thodoris Zois
Changeset: 804e71b4bac3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=804e71b4bac3
Modified Files:
monetdb5/scheduler/run_memo.c
Branch: gdk_tracer
Log Message:

Fix - compilation issue on macOS only


diffs (21 lines):

diff --git a/monetdb5/scheduler/run_memo.c b/monetdb5/scheduler/run_memo.c
--- a/monetdb5/scheduler/run_memo.c
+++ b/monetdb5/scheduler/run_memo.c
@@ -176,7 +176,7 @@ RUNchoice(Client cntxt, MalBlkPtr mb, Ma
}
}
 
-   TRC_DEBUG(MAL_MEMO, "Function target '%s' cost: %ld\n", getVarName(mb, 
target), mincost);
+   TRC_DEBUG(MAL_MEMO, "Function target '%s' cost: %ld\n", getVarName(mb, 
target), (long) mincost);
(void) cntxt;
 
/* remove non-qualifying variables */
@@ -188,7 +188,7 @@ RUNchoice(Client cntxt, MalBlkPtr mb, Ma
 
propagateNonTarget(mb, pc + 1);
 
-   TRC_DEBUG(MAL_MEMO, "Cost choice selected: %s %ld\n", getVarName(mb, 
target), mincost);
+   TRC_DEBUG(MAL_MEMO, "Cost choice selected: %s %ld\n", getVarName(mb, 
target), (long) mincost);
debugFunction(MAL_MEMO, mb, stk, 1);
 
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-12-03 Thread Sjoerd Mullender
Changeset: 3c2bf1acbc06 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c2bf1acbc06
Modified Files:
gdk/gdk_batop.c
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (266 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -839,27 +839,247 @@ BATdel(BAT *b, BAT *d)
 gdk_return
 BATreplace(BAT *b, BAT *p, BAT *n, bool force)
 {
-   BUN r, s;
-   BATiter nvi = bat_iterator(n);
-   oid hseqend;
-
-   if (b == NULL || b->ttype == TYPE_void ||
-   p == NULL || n == NULL || BATcount(n) == 0) {
+   if (b == NULL || b->ttype == TYPE_void || p == NULL || n == NULL) {
+   return GDK_SUCCEED;
+   }
+   if (BATcount(p) != BATcount(n)) {
+   GDKerror("BATreplace: update BATs not the same size\n");
+   return GDK_FAIL;
+   }
+   if (ATOMtype(p->ttype) != TYPE_oid) {
+   GDKerror("BATreplace: positions BAT not type OID\n");
+   return GDK_FAIL;
+   }
+   if (BATcount(n) == 0) {
return GDK_SUCCEED;
}
-   hseqend = b->hseqbase + BATcount(b);
-   BATloop(n, r, s) {
-   oid updid = BUNtoid(p, r);
-   const void *val = BUNtail(nvi, r);
+   if (!force && (b->batRestricted != BAT_WRITE || b->batSharecnt > 0)) {
+   GDKerror("BATreplace: access denied to %s, aborting.\n",
+BATgetId(b));
+   return GDK_FAIL;
+   }
+
+   HASHdestroy(b);
+   OIDXdestroy(b);
+   IMPSdestroy(b);
+
+   b->tsorted = b->trevsorted = false;
+   b->tnosorted = b->tnorevsorted = 0;
+   b->tkey = false;
+   b->tnokey[0] = b->tnokey[1] = 0;
+
+   const PROPrec *maxprop = BATgetprop(b, GDK_MAX_VALUE);
+   const PROPrec *minprop = BATgetprop(b, GDK_MIN_VALUE);
+   int (*atomcmp)(const void *, const void *) = ATOMcompare(b->ttype);
+   const void *nil = ATOMnilptr(b->ttype);
+   oid hseqend = b->hseqbase + BATcount(b);
+   BATiter bi = bat_iterator(b);
+   BATiter ni = bat_iterator(n);
+   bool anynil = false;
+
+   b->theap.dirty = true;
+   if (b->tvarsized) {
+   b->tvheap->dirty = true;
+   for (BUN i = 0, j = BATcount(p); i < j; i++) {
+   oid updid = BUNtoid(p, i);
+
+   if (updid < b->hseqbase || updid >= hseqend) {
+   GDKerror("BATreplace: id out of range\n");
+   return GDK_FAIL;
+   }
+   updid -= b->hseqbase;
+   if (!force && updid < b->batInserted) {
+   GDKerror("BATreplace: updating committed 
value\n");
+   return GDK_FAIL;
+   }
+
+   const void *old = BUNtvar(bi, updid);
+   const void *new = BUNtvar(ni, i);
+   bool isnil = atomcmp(new, nil) == 0;
+   anynil |= isnil;
+   if (b->tnil &&
+   !anynil &&
+   atomcmp(old, nil) == 0) {
+   /* if old value is nil and no new
+* value is, we're not sure anymore
+* about the nil property, so we must
+* clear it */
+   b->tnil = false;
+   }
+   b->tnonil &= !isnil;
+   b->tnil |= isnil;
+   if (maxprop) {
+   if (!isnil &&
+   atomcmp(VALptr(>v), new) < 0) {
+   /* new value is larger than
+* previous largest */
+   BATsetprop(b, GDK_MAX_VALUE, b->ttype, 
new);
+   maxprop = BATgetprop(b, GDK_MAX_VALUE);
+   } else if (atomcmp(VALptr(>v), old) == 
0 &&
+  atomcmp(new, old) != 0) {
+   /* old value is equal to
+* largest and new value is
+* smaller, so we don't know
+* anymore which is the
+* largest */
+   BATrmprop(b, GDK_MAX_VALUE);
+   maxprop = NULL;
+   }
+   }
+   if (minprop) {
+   if (!isnil &&
+   atomcmp(VALptr(>v), new) > 0) {
+   /* new value is 

MonetDB: Nov2019 - Turned BATreplace into bulk function + call i...

2019-12-03 Thread Sjoerd Mullender
Changeset: d96b689b2c74 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d96b689b2c74
Modified Files:
gdk/gdk_batop.c
monetdb5/modules/kernel/bat5.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
Branch: Nov2019
Log Message:

Turned BATreplace into bulk function + call it instead of void_replace_bat.


diffs (truncated from 366 to 300 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -929,12 +929,252 @@ BATdel(BAT *b, BAT *d)
 gdk_return
 BATreplace(BAT *b, BAT *p, BAT *n, bool force)
 {
-   if (b == NULL || p == NULL || n == NULL || BATcount(n) == 0) {
+   if (b == NULL || b->ttype == TYPE_void || p == NULL || n == NULL) {
+   return GDK_SUCCEED;
+   }
+   if (BATcount(p) != BATcount(n)) {
+   GDKerror("BATreplace: update BATs not the same size\n");
+   return GDK_FAIL;
+   }
+   if (ATOMtype(p->ttype) != TYPE_oid) {
+   GDKerror("BATreplace: positions BAT not type OID\n");
+   return GDK_FAIL;
+   }
+   if (BATcount(n) == 0) {
return GDK_SUCCEED;
}
-   if (void_replace_bat(b, p, n, force) != GDK_SUCCEED)
+   if (!force && (b->batRestricted != BAT_WRITE || b->batSharecnt > 0)) {
+   GDKerror("BATreplace: access denied to %s, aborting.\n",
+BATgetId(b));
return GDK_FAIL;
+   }
+   if (b->tunique) {
+   /* do it the old-fashioned way so that tunique
+* property is obeyed */
+   return void_replace_bat(b, p, n, force);
+   }
+
+   HASHdestroy(b);
+   OIDXdestroy(b);
+   IMPSdestroy(b);
+
+   b->tsorted = b->trevsorted = false;
+   b->tnosorted = b->tnorevsorted = 0;
+   b->tkey = false;
+   b->tnokey[0] = b->tnokey[1] = 0;
+
+   const PROPrec *maxprop = BATgetprop(b, GDK_MAX_VALUE);
+   const PROPrec *minprop = BATgetprop(b, GDK_MIN_VALUE);
+   int (*atomcmp)(const void *, const void *) = ATOMcompare(b->ttype);
+   const void *nil = ATOMnilptr(b->ttype);
+   oid hseqend = b->hseqbase + BATcount(b);
+   BATiter bi = bat_iterator(b);
+   BATiter ni = bat_iterator(n);
+   bool anynil = false;
+
+   b->theap.dirty = true;
+   if (b->tvarsized) {
+   b->tvheap->dirty = true;
+   for (BUN i = 0, j = BATcount(p); i < j; i++) {
+   oid updid = BUNtoid(p, i);
+
+   if (updid < b->hseqbase || updid >= hseqend) {
+   GDKerror("BATreplace: id out of range\n");
+   return GDK_FAIL;
+   }
+   updid -= b->hseqbase;
+   if (!force && updid < b->batInserted) {
+   GDKerror("BATreplace: updating committed 
value\n");
+   return GDK_FAIL;
+   }
+
+   const void *old = BUNtvar(bi, updid);
+   const void *new = BUNtvar(ni, i);
+   bool isnil = atomcmp(new, nil) == 0;
+   anynil |= isnil;
+   if (b->tnil &&
+   !anynil &&
+   atomcmp(old, nil) == 0) {
+   /* if old value is nil and no new
+* value is, we're not sure anymore
+* about the nil property, so we must
+* clear it */
+   b->tnil = false;
+   }
+   b->tnonil &= !isnil;
+   b->tnil |= isnil;
+   if (maxprop) {
+   if (!isnil &&
+   atomcmp(VALptr(>v), new) < 0) {
+   /* new value is larger than
+* previous largest */
+   BATsetprop(b, GDK_MAX_VALUE, b->ttype, 
new);
+   maxprop = BATgetprop(b, GDK_MAX_VALUE);
+   } else if (atomcmp(VALptr(>v), old) == 
0 &&
+  atomcmp(new, old) != 0) {
+   /* old value is equal to
+* largest and new value is
+* smaller, so we don't know
+* anymore which is the
+* largest */
+   BATrmprop(b, GDK_MAX_VALUE);
+   maxprop = NULL;
+   }
+   }
+   if (minprop) {
+   if (!isnil &&
+   

MonetDB: gdk_tracer - Added macro for exception handling

2019-12-03 Thread Thodoris Zois
Changeset: 03f6ac5cb517 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=03f6ac5cb517
Modified Files:
gdk/gdk_tracer.h
Branch: gdk_tracer
Log Message:

Added macro for exception handling


diffs (40 lines):

diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h
--- a/gdk/gdk_tracer.h
+++ b/gdk/gdk_tracer.h
@@ -13,7 +13,7 @@
 #define BUFFER_SIZE 64000
 
 #define DEFAULT_ADAPTER BASIC
-#define DEFAULT_LOG_LEVEL M_DEBUG
+#define DEFAULT_LOG_LEVEL M_ERROR
 #define DEFAULT_FLUSH_LEVEL M_INFO
 
 #define FILE_NAME "trace"
@@ -200,7 +200,7 @@ static const char *COMPONENT_STR[] = {
 extern LOG_LEVEL LVL_PER_COMPONENT[];
 
 // If the LOG_LEVEL of the message is one of the following: CRITICAL, ERROR or 
WARNING 
-// it is logged no matter the component. In any other case the component is 
taken into account (needs fix)
+// it is logged no matter the component. In any other case the component is 
taken into account
 #define GDK_TRACER_LOG(LOG_LEVEL, COMP, MSG, ...)\
 if(LOG_LEVEL == M_CRITICAL ||\
LOG_LEVEL == M_ERROR||\
@@ -247,6 +247,18 @@ gdk_tracer;
 
 
 /*
+ * GDKtracer Stream Usage
+ */
+// Exception
+#define GDK_TRACER_REPORT_EXCEPTION(MSG) \
+mnstr_printf(GDKstdout, "[%s] %s %s:%d M_CRITICAL GDK_TRACER %s # "MSG,  \
+GDKtracer_get_timestamp("%Y-%m-%d %H:%M:%S"),\
+__FILENAME__,\
+__FUNCTION__,\
+__LINE__,\
+MT_thread_getname());\
+
+/*
  *  GDKtracer API
  */
 // Returns the timestamp in the form of datetime
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: gdk_tracer - Exception handling for failing GDKtracer r...

2019-12-03 Thread Thodoris Zois
Changeset: 8211183b107e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8211183b107e
Modified Files:
monetdb5/mal/mal_errors.h
monetdb5/mal/mal_exception.c
monetdb5/mal/mal_exception.h
monetdb5/modules/mal/tracer.c
Branch: gdk_tracer
Log Message:

Exception handling for failing GDKtracer routines in MAL layer


diffs (139 lines):

diff --git a/monetdb5/mal/mal_errors.h b/monetdb5/mal/mal_errors.h
--- a/monetdb5/mal/mal_errors.h
+++ b/monetdb5/mal/mal_errors.h
@@ -88,6 +88,7 @@
 #define RUNTIME_QRY_TIMEOUT "Query aborted due to timeout"
 #define RUNTIME_SESSION_TIMEOUT "Query aborted due to session timeout"
 #define OPERATION_FAILED "operation failed"
+#define _OPERATION_FAILED "Operation failed"
 
 #define BOX_CLOSED "Box is not open"
 
diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c
--- a/monetdb5/mal/mal_exception.c
+++ b/monetdb5/mal/mal_exception.c
@@ -29,6 +29,7 @@ static char *exceptionNames[] = {
 /*11 */"ArithmeticException",
 /*12 */"PermissionDeniedException",
 /*13 */"SQLException",
+/*14 */ "TracerException",
 /*15 */"Deprecated operation",
 /*EOE*/NULL
 };
diff --git a/monetdb5/mal/mal_exception.h b/monetdb5/mal/mal_exception.h
--- a/monetdb5/mal/mal_exception.h
+++ b/monetdb5/mal/mal_exception.h
@@ -26,7 +26,8 @@ enum malexception {
PARSE,
ARITH,
PERMD,
-   SQL
+   SQL,
+   TRACER
 };
 
 #define MAL_SUCCEED ((str) 0) /* no error */
diff --git a/monetdb5/modules/mal/tracer.c b/monetdb5/modules/mal/tracer.c
--- a/monetdb5/modules/mal/tracer.c
+++ b/monetdb5/modules/mal/tracer.c
@@ -16,9 +16,9 @@ str
 TRACERflush_buffer(void)
 {
 GDK_result = GDKtracer_flush_buffer();
-// if(GDK_result == GDK_FAIL)
-
-
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, _OPERATION_FAILED); 
+
 return MAL_SUCCEED;
 }
 
@@ -28,8 +28,8 @@ TRACERset_component_level(void *ret, int
 {
 (void) ret;
 GDK_result = GDKtracer_set_component_level(comp, lvl);
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, ILLEGAL_ARGUMENT); 
 
 return MAL_SUCCEED; 
 }
@@ -39,8 +39,8 @@ str
 TRACERreset_component_level(int *comp)
 {
 GDK_result = GDKtracer_reset_component_level(comp);
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, _OPERATION_FAILED); 
 
 return MAL_SUCCEED;
 }
@@ -51,8 +51,8 @@ TRACERset_layer_level(void *ret, int *la
 {
 (void) ret;
 GDK_result = GDKtracer_set_layer_level(layer, lvl);
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, ILLEGAL_ARGUMENT); 
 
 return MAL_SUCCEED; 
 }
@@ -62,8 +62,8 @@ str
 TRACERreset_layer_level(int *layer)
 {
 GDK_result = GDKtracer_reset_layer_level(layer);
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, _OPERATION_FAILED); 
 
 return MAL_SUCCEED;
 }
@@ -74,8 +74,8 @@ TRACERset_flush_level(void *ret, int *lv
 {
 (void) ret;
 GDK_result = GDKtracer_set_flush_level(lvl);
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, ILLEGAL_ARGUMENT); 
 
 return MAL_SUCCEED;
 }
@@ -85,8 +85,8 @@ str
 TRACERreset_flush_level(void)
 {
 GDK_result = GDKtracer_reset_flush_level();
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, _OPERATION_FAILED); 
 
 return MAL_SUCCEED;
 }
@@ -97,8 +97,8 @@ TRACERset_adapter(void *ret, int *adapte
 {
 (void) ret;
 GDK_result = GDKtracer_set_adapter(adapter);
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, ILLEGAL_ARGUMENT); 
 
 return MAL_SUCCEED;
 }
@@ -108,8 +108,8 @@ str
 TRACERreset_adapter(void)
 {
 GDK_result = GDKtracer_reset_adapter();
-// if(GDK_result == GDK_FAIL)
-// throw(TRACER, __FILE__, "%s:%s", __func__, OPERATION_FAILED);
+if(GDK_result == GDK_FAIL)
+throw(TRACER, __FUNCTION__, _OPERATION_FAILED); 
 
 return MAL_SUCCEED;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - New sqlsmith crash

2019-12-03 Thread Pedro Ferreira
Changeset: 9e5456ec55f1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9e5456ec55f1
Modified Files:
sql/test/mergetables/Tests/sqlsmith-exists.sql
Branch: default
Log Message:

New sqlsmith crash


diffs (122 lines):

diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.sql 
b/sql/test/mergetables/Tests/sqlsmith-exists.sql
--- a/sql/test/mergetables/Tests/sqlsmith-exists.sql
+++ b/sql/test/mergetables/Tests/sqlsmith-exists.sql
@@ -232,4 +232,118 @@ where subq_0.c0 is not null
 limit 107
 ;
 
+CREATE TABLE integers(i INTEGER);
+INSERT INTO integers VALUES (1), (2), (3), (NULL);
+CREATE TABLE tbl_ProductSales (ColID int, Product_Category  varchar(64), 
Product_Name  varchar(64), TotalSales int); 
+INSERT INTO tbl_ProductSales VALUES (1,'Game','Mobo Game',200),(2,'Game','PKO 
Game',400),(3,'Fashion','Shirt',500),(4,'Fashion','Shorts',100);
+create table analytics (aa int, bb int, cc bigint);
+insert into analytics values (15, 3, 15), (3, 1, 3), (2, 1, 2), (5, 3, 5), 
(NULL, 2, NULL), (3, 2, 3), (4, 1, 4), (6, 3, 6), (8, 2, 8), (NULL, 4, NULL);
+
+SELECT subq_1.c3 AS c0
+FROM
+  (SELECT 1 AS c0,
+  subq_0.c8 AS c1,
+  subq_0.c6 AS c2,
+  subq_0.c0 AS c3,
+  subq_0.c4 AS c4,
+  subq_0.c9 AS c5,
+  subq_0.c6 AS c6,
+  subq_0.c0 AS c7,
+  subq_0.c3 AS c8,
+  subq_0.c4 AS c9,
+  CASE
+  WHEN (94 IS NOT NULL)
+   OR (subq_0.c0 IS NULL) THEN subq_0.c4
+  ELSE subq_0.c4
+  END AS c10,
+  subq_0.c5 AS c11,
+  subq_0.c4 AS c12
+   FROM
+ (SELECT ref_0.i AS c0,
+ ref_0.i AS c1,
+ ref_0.i AS c2,
+ ref_0.i AS c3,
+ ref_0.i AS c4,
+ ref_0.i AS c5,
+ ref_0.i AS c6,
+ ref_0.i AS c7,
+ ref_0.i AS c8,
+ ref_0.i AS c9,
+ ref_0.i AS c10
+  FROM sys.integers AS ref_0
+  WHERE (ref_0.i IS NOT NULL)
+OR (TRUE)) AS subq_0
+   WHERE CASE
+ WHEN (TRUE)
+  AND (TRUE))
+ AND (EXISTS
+(SELECT subq_0.c3 AS c0,
+ref_1.value AS c1,
+subq_0.c1 AS c2,
+subq_0.c3 AS c3,
+subq_0.c10 AS c4
+ FROM sys.value_partitions AS ref_1
+ WHERE (ref_1.value IS NULL)
+   OR ((subq_0.c2 IS NULL)
+   OR ((FALSE)
+   AND ((ref_1.value IS NULL)
+OR ((TRUE)
+OR (ref_1.table_id IS 
NULL
+OR (FALSE))
+   AND (TRUE)
+   AND (((EXISTS
+(SELECT 69 AS c0,
+ref_2.product_category AS c1,
+ref_2.product_name AS c2,
+ref_2.totalsales AS c3,
+subq_0.c0 AS c4,
+ref_2.colid AS c5,
+subq_0.c5 AS c6,
+subq_0.c8 AS c7,
+subq_0.c10 AS c8
+ FROM sys.tbl_productsales AS ref_2
+ WHERE (FALSE)
+   OR ((FALSE)
+   AND ((TRUE)
+OR ((TRUE)
+OR (TRUE))
+ AND (TRUE))
+OR ((FALSE)
+OR ((subq_0.c0 IS NOT NULL)
+OR (subq_0.c8 IS NULL)
+  AND (subq_0.c5 IS NOT NULL))
+ AND ((EXISTS
+ (SELECT subq_0.c9 AS c0,
+ subq_0.c6 AS c1,
+ subq_0.c7 AS c2,
+ subq_0.c7 AS c3,
+ ref_3.name AS c4,
+ ref_3.cycle AS c5,
+ ref_3.cacheinc AS c6,
+ subq_0.c8 AS c7,
+ ref_3.minvalue AS c8,
+ ref_3.start AS c9,
+ subq_0.c4 AS c10,
+ ref_3.id AS c11,
+ 

MonetDB: default - merged

2019-12-03 Thread Niels Nes
Changeset: 8e777c2d06aa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8e777c2d06aa
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
debian/monetdb5-server.install
gdk/ChangeLog
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/ChangeLog
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/Tests/inspect05.malC
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
sql/backends/monet5/sql_statement.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
Branch: default
Log Message:

merged


diffs (truncated from 884 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -681,7 +681,6 @@ stdout of test 'MAL-signatures` in direc
 [ "bat",   "setColumn","command bat.setColumn(b:bat[:any_1], 
t:str):void ","BKCsetColumn;","Give a logical name to the tail 
column of a BAT."  ]
 [ "bat",   "setHash",  "command bat.setHash(b:bat[:any_1]):bit ",  
"BKCsetHash;",  "Create a hash structure on the column" ]
 [ "bat",   "setImprints",  "command bat.setImprints(b:bat[:any_1]):bit ",  
"BKCsetImprints;",  "Create an imprints structure on the column"]
-[ "bat",   "setKey",   "command bat.setKey(b:bat[:any_1], 
mode:bit):bat[:any_1] ", "BKCsetkey;",   "Sets the 'key' property of the 
tail column to 'mode'. In 'key' mode,\nthe kernel will silently block 
insertions that cause a duplicate\nentry in the head column." ]
 [ "bat",   "setName",  "command bat.setName(b:bat[:any_1], s:str):void 
",  "BKCsetName;",  "Give a logical name to a BAT. "]
 [ "bat",   "setPersistent","command 
bat.setPersistent(b:bat[:any_1]):void ",   "BKCsetPersistent;","Make 
the BAT persistent."  ]
 [ "bat",   "setTransient", "command bat.setTransient(b:bat[:any_1]):void 
","BKCsetTransient;", "Make the BAT transient.  Returns \n\tboolean 
which indicates if the\nBAT administration has indeed changed."   ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -787,7 +787,6 @@ stdout of test 'MAL-signatures` in direc
 [ "bat",   "setColumn","command bat.setColumn(b:bat[:any_1], 
t:str):void ","BKCsetColumn;","Give a logical name to the tail 
column of a BAT."  ]
 [ "bat",   "setHash",  "command bat.setHash(b:bat[:any_1]):bit ",  
"BKCsetHash;",  "Create a hash structure on the column" ]
 [ "bat",   "setImprints",  "command bat.setImprints(b:bat[:any_1]):bit ",  
"BKCsetImprints;",  "Create an imprints structure on the column"]
-[ "bat",   "setKey",   "command bat.setKey(b:bat[:any_1], 
mode:bit):bat[:any_1] ", "BKCsetkey;",   "Sets the 'key' property of the 
tail column to 'mode'. In 'key' mode,\nthe kernel will silently block 
insertions that cause a duplicate\nentry in the head column." ]
 [ "bat",   "setName",  "command bat.setName(b:bat[:any_1], s:str):void 
",  "BKCsetName;",  "Give a logical name to a BAT. "]
 [ "bat",   "setPersistent","command 
bat.setPersistent(b:bat[:any_1]):void ",   "BKCsetPersistent;","Make 
the BAT persistent."  ]
 [ "bat",   "setTransient", "command bat.setTransient(b:bat[:any_1]):void 
","BKCsetTransient;", "Make the BAT transient.  Returns \n\tboolean 
which indicates if the\nBAT administration has indeed changed."   ]
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -484,7 +484,6 @@ size_t strLen(const char *s);
 int strNil(const char *s);
 const char str_nil[2];
 gdk_return void_inplace(BAT *b, oid id, const void *val, bool force) 
__attribute__((__warn_unused_result__));
-gdk_return void_replace_bat(BAT *b, BAT *p, BAT *u, bool force) 
__attribute__((__warn_unused_result__));
 int win_mkdir(const char *, const int mode);
 int win_rename(const char *, const char *);
 int win_rmdir(const char *);
@@ -857,7 +856,6 @@ str BKCsetImprints(bit *ret, const bat *
 str BKCsetName(void *r, const bat *bid, const char *const *s);
 str BKCsetPersistent(void *r, const bat *bid);
 str BKCsetTransient(void *r, const bat *bid);
-str BKCsetkey(bat *res, const bat *bid, const bit *param);
 str BKCshrinkBAT(bat *ret, const bat *bid, const bat *did);
 

MonetDB: default - fixed problem with outer join expressions wit...

2019-12-03 Thread Niels Nes
Changeset: 8bb7b1a8c62d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8bb7b1a8c62d
Modified Files:
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/rel_unnest.h
sql/test/mergetables/Tests/sqlsmith-exists.stable.out
Branch: default
Log Message:

fixed problem with outer join expressions with subqueries


diffs (92 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1074,6 +1074,8 @@ rel_column_ref(sql_query *query, sql_rel
exp->card = CARD_ATOM;
set_freevar(exp, i);
}
+   if (exp && outer && is_join(outer->op))
+   set_dependent(outer);
}
if (exp) {
if (var || a)
@@ -1135,6 +1137,8 @@ rel_column_ref(sql_query *query, sql_rel
exp->card = CARD_ATOM;
set_freevar(exp, i);
}
+   if (exp && outer && is_join(outer->op))
+   set_dependent(outer);
}
 
/* some views are just in the stack,
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -66,8 +66,6 @@ exps_set_freevar(mvc *sql, list *exps, s
exp_set_freevar(sql, n->data, r);
 }
 
-static int exps_have_freevar(mvc *sql, list *exps);
-
 /* check if the set is distinct for the set of free variables */
 static int
 is_distinct_set(mvc *sql, sql_rel *rel, list *ad)
@@ -123,7 +121,7 @@ exp_has_freevar(mvc *sql, sql_exp *e)
return 0;
 }
 
-static int
+int
 exps_have_freevar(mvc *sql, list *exps)
 {
node *n;
diff --git a/sql/server/rel_unnest.h b/sql/server/rel_unnest.h
--- a/sql/server/rel_unnest.h
+++ b/sql/server/rel_unnest.h
@@ -13,6 +13,7 @@
 #include "sql_mvc.h"
 
 extern int exp_has_freevar(mvc *sql, sql_exp *e);
+extern int exps_have_freevar(mvc *sql, list *exps);
 extern int rel_has_freevar(mvc *sql, sql_rel *r);
 extern sql_rel *rel_unnest(mvc *sql, sql_rel *rel);
 extern void exps_set_freevar(mvc *sql, list *exps, sql_rel *r);
diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out 
b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out
--- a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out
+++ b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out
@@ -102,6 +102,35 @@ stdout of test 'sqlsmith-exists` in dire
 % c0,  c1, c2, c3, c4, c5 # name
 % int, int,varchar,int,int,varchar # type
 % 1,   1,  0,  1,  1,  0 # length
+#select 
+# subq_0.c0 as c0, 
+# subq_0.c0 as c1, 
+# cast(coalesce(4,
+# subq_0.c0) as int) as c2, 
+# case when subq_0.c0 is null then subq_0.c0 else subq_0.c0 end
+# as c3, 
+# subq_0.c0 as c4, 
+# subq_0.c0 as c5, 
+# subq_0.c0 as c6, 
+# subq_0.c0 as c7
+#from 
+# (select 
+# ref_4.type as c0
+# from 
+# sys.storagemodel as ref_0
+# right join sys.triggers as ref_1
+# right join sys.environment as ref_2
+# on (exists (
+# select 
+# ref_2.name as c0, 
+# ref_2.value as c1
+# from 
+# sys.dependency_owners_on_schemas as ref_3
+# where ref_1.table_id is null))
+% sys.%62, sys.%63,.%64,   sys.%65,sys.%66,
sys.%67,sys.%70,sys.%71 # table_name
+% c0,  c1, c2, c3, c4, c5, c6, c7 # name
+% int, int,int,int,int,int,int,int # type
+% 1,   1,  1,  1,  1,  1,  1,  1 # length
 #ROLLBACK;
 
 # 19:56:32 >  
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


monetdb-ruby: default - Updated version number and copyright year.

2019-12-03 Thread Sjoerd Mullender
Changeset: 6abcfcdb4924 for monetdb-ruby
URL: https://dev.monetdb.org/hg/monetdb-ruby?cmd=changeset;node=6abcfcdb4924
Modified Files:
Makefile
debian/changelog
debian/control
debian/copyright
lib/MonetDB.rb
lib/MonetDBConnection.rb
lib/MonetDBData.rb
lib/MonetDBExceptions.rb
lib/example.rb
lib/hasher.rb
monetdb-sql.gemspec
rubygem-monetdb-sql.spec
Branch: default
Log Message:

Updated version number and copyright year.


diffs (160 lines):

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 1.1
+VERSION = 1.2
 
 monetdb-sql-$(VERSION).gem: monetdb-sql.gemspec \
lib/MonetDB.rb lib/MonetDBConnection.rb \
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-monetdb-sql (1.2) unstable; urgency=low
+
+  * Look for column names starting with '%' symbol at parse_header_table.
+
+ -- Pedro Ferreira   Tue, 03 Dec 2019 
14:12:22 +0100
+
 ruby-monetdb-sql (1.1) unstable; urgency=low
 
   * Fixed the blocksize in the Mapi protocol.
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -5,8 +5,8 @@ Maintainer: MonetDB BV = 9~),
gem2deb
 Standards-Version: 3.9.6
-Vcs-Hg: http://dev.monetdb.org/hg/monetdb-ruby/
-Vcs-Browser: http://dev.monetdb.org/hg/monetdb-ruby/
+Vcs-Hg: https://dev.monetdb.org/hg/monetdb-ruby/
+Vcs-Browser: https://dev.monetdb.org/hg/monetdb-ruby/
 Homepage: https://www.monetdb.org/
 Testsuite: autopkgtest-pkg-ruby
 XS-Ruby-Versions: all
diff --git a/debian/copyright b/debian/copyright
--- a/debian/copyright
+++ b/debian/copyright
@@ -4,10 +4,10 @@ Upstream-Contact: i...@monetdb.org
 Source: http://dev.monetdb.org/downloads/
 
 Files: *
-Copyright: 2017 MonetDB B.V.
+Copyright: 2019 MonetDB B.V.
 License: MPL-2.0
  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/.
  .
- Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+ Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
diff --git a/lib/MonetDB.rb b/lib/MonetDB.rb
--- a/lib/MonetDB.rb
+++ b/lib/MonetDB.rb
@@ -2,7 +2,7 @@
 # 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/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 # = Introduction
 #
diff --git a/lib/MonetDBConnection.rb b/lib/MonetDBConnection.rb
--- a/lib/MonetDBConnection.rb
+++ b/lib/MonetDBConnection.rb
@@ -2,7 +2,7 @@
 # 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/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 # Implements the MAPI communication protocol
 
diff --git a/lib/MonetDBData.rb b/lib/MonetDBData.rb
--- a/lib/MonetDBData.rb
+++ b/lib/MonetDBData.rb
@@ -2,7 +2,7 @@
 # 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/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 # Models a MonetDB RecordSet
 require 'time'
diff --git a/lib/MonetDBExceptions.rb b/lib/MonetDBExceptions.rb
--- a/lib/MonetDBExceptions.rb
+++ b/lib/MonetDBExceptions.rb
@@ -2,7 +2,7 @@
 # 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/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 # Exception classes for the ruby-monetdb driver
 
diff --git a/lib/example.rb b/lib/example.rb
--- a/lib/example.rb
+++ b/lib/example.rb
@@ -2,7 +2,7 @@
 # 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/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 require_relative 'MonetDB'
 
diff --git a/lib/hasher.rb b/lib/hasher.rb
--- a/lib/hasher.rb
+++ b/lib/hasher.rb
@@ -2,7 +2,7 @@
 # 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/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 require 'digest/md5'
 require 'digest/sha1'
diff --git a/monetdb-sql.gemspec b/monetdb-sql.gemspec
--- a/monetdb-sql.gemspec
+++ b/monetdb-sql.gemspec
@@ -2,8 +2,8 @@
 Gem::Specification.new do |s|

monetdb-ruby: default - Look for column names starting with '%' ...

2019-12-03 Thread Pedro Ferreira
Changeset: 83db5acbd01a for monetdb-ruby
URL: https://dev.monetdb.org/hg/monetdb-ruby?cmd=changeset;node=83db5acbd01a
Modified Files:
lib/MonetDBData.rb
Branch: default
Log Message:

Look for column names starting with '%' symbol at parse_header_table


diffs (65 lines):

diff --git a/lib/MonetDBData.rb b/lib/MonetDBData.rb
--- a/lib/MonetDBData.rb
+++ b/lib/MonetDBData.rb
@@ -153,6 +153,11 @@ class MonetDBData
  return @query['columns'].to_i
end
 
+  # Returns the (ordered) name of the columns' tables in the record set
+  def table_name_fields
+return @header['table_name']
+  end
+
   # Returns the (ordered) name of the columns in the record set
   def name_fields
 return @header['columns_name']
@@ -296,23 +301,39 @@ class MonetDBData
   def parse_header_table(header_t)
 if @query["type"] == MonetDBConnection::Q_TABLE
   if header_t != nil
-name_t = header_t[0].split(' ')[1].gsub(/,$/, '')
-name_cols = Array.new
   
-header_t[1].split('%')[1].gsub(/'^\%'/, '').split('#')[0].split(' 
').each do |col|
-  name_cols << col.gsub(/,$/, '')
+name_t = header_t[0][2..-15].split(' ') # remove # table_name
+name_t.each_with_index do |col, i|
+if i != name_t.length - 1
+  name_t[i] = col[0..-2] # remove trailing comma
+end
+end
+  
+name_cols = header_t[1][2..-9].split(' ') # remove # name
+name_cols.each_with_index do |col, i|
+if i != name_cols.length - 1
+  name_cols[i] = col[0..-2] # remove trailing comma
+end
 end
   
 type_cols = { }
-header_t[2].split('%')[1].gsub(/'^\%'/, '').split('#')[0].split(' 
').each_with_index do |col, i|
-  if  col.gsub(/,$/, '') != nil
-type_cols[ name_cols[i] ] = col.gsub(/,$/, '') 
-  end
+type_cols_array = header_t[2][2..-9].split(' ') # remove # type
+type_cols_array.each_with_index do |col, i|
+if i != type_cols_array.length - 1
+  type_cols[name_cols[i]] = col[0..-2] # remove trailing comma
+else
+  type_cols[name_cols[i]] = col
+end
 end
   
 length_cols = { }
-header_t[3].split('%')[1].gsub(/'^\%'/, '').split('#')[0].split(' 
').each_with_index do |col, i|
-  length_cols[ name_cols[i] ] = col.gsub(/,$/, '')
+length_cols_array = header_t[3][2..-11].split(' ') # remove # length
+length_cols_array.each_with_index do |col, i|
+if i != length_cols_array.length - 1
+  length_cols[name_cols[i]] = col[0..-2] # remove trailing comma
+else
+  length_cols[name_cols[i]] = col
+end
 end
   
 columns_order = {}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Nov2019 branch.

2019-12-03 Thread Sjoerd Mullender
Changeset: afe779b2cab8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afe779b2cab8
Modified Files:
debian/monetdb5-server.install
monetdb5/modules/mal/Tests/inspect05.malC
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 307 to 300 lines):

diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,16 +1,17 @@
 debian/tmp/usr/bin/mserver5 usr/bin
 debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so.* usr/lib/x86_64-linux-gnu
 
-# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{bam,geom,gsl,lidar,pyapi,rapi,sql}.so
+# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{bam,fits,geom,gsl,lidar,pyapi*,rapi,sql}.so
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_capi.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_generator.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_opt_sql_append.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_udf.so 
usr/lib/x86_64-linux-gnu/monetdb5
 
-# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT: 
{bam,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bglprsu]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
+# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT: 
{bam,fits,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bfglprsu]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/ba[!m]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/b[!a]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/f[!i]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/generator.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/g[!es]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/l[!i]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
diff --git a/monetdb5/modules/mal/Tests/inspect05.malC 
b/monetdb5/modules/mal/Tests/inspect05.malC
--- a/monetdb5/modules/mal/Tests/inspect05.malC
+++ b/monetdb5/modules/mal/Tests/inspect05.malC
@@ -1,17 +1,17 @@
 #Illustrate the modules loaded after start
 m:= inspect.getModule();
 m0:= algebra.select(m,nil:bat[:oid],"bat", "bat", true,true,false);# limit 
the list
-m1:= algebra.projection(m0,m);
 k:= inspect.getKind();
-k0:= algebra.projection(m0,k);
 f:= inspect.getFunction();
+s:= inspect.getSignatures();
+a:= inspect.getAddresses();
+
 f0:= algebra.projection(m0,f);
-s:= inspect.getSignatures();
-s0:= algebra.projection(m0,s);
-a:= inspect.getAddresses();
-a0:= algebra.projection(m0,a);
-
 (fv,forder):= algebra.sort(f0,false,false,true);
 
+m1:= algebra.projectionpath(forder,m0,m);
+k0:= algebra.projectionpath(forder,m0,k);
+s0:= algebra.projectionpath(forder,m0,s);
+a0:= algebra.projectionpath(forder,m0,a);
+
 io.print(fv,k0,m1,s0,a0);
-
diff --git a/monetdb5/modules/mal/Tests/inspect05.stable.out 
b/monetdb5/modules/mal/Tests/inspect05.stable.out
--- a/monetdb5/modules/mal/Tests/inspect05.stable.out
+++ b/monetdb5/modules/mal/Tests/inspect05.stable.out
@@ -29,46 +29,46 @@ stdout of test 'inspect05` in directory 
 # str  str str str str  # type
 #--#
 [ 0@0, "append",   "command",  "bat",  "(i:bat[:any_1], 
u:any_1):bat[:any_1] ","BKCappend_val_wrap;"   ]
-[ 1@0, "append",   "command",  "bat",  "(tt:int, 
heapfile:str):bat[:any_1] ",  "BKCattach;"]
-[ 2@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:any_1, 
force:bit):bat[:any_1] ", "BKCappend_val_force_wrap;" ]
-[ 3@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid], force:bit):bat[:any_1] ",  "BKCappend_cand_force_wrap;"]
-[ 4@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid]):bat[:any_1] ", "BKCappend_cand_wrap;"  ]
-[ 5@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
force:bit):bat[:any_1] ",   "BKCappend_force_wrap;" ]
-[ 6@0, "attach",   "command",  "bat",  "(i:bat[:any_1], 
u:bat[:any_1]):bat[:any_1] ",  "BKCappend_wrap;"   ]
-[ 7@0, "delete",   "command",  "bat",  "(a:bat[:oid], 
b:bat[:oid]):bat[:oid] ","BKCdiffcand;"  ]
-[ 8@0, "delete",   "command",  "bat",  "(sz:lng):bat[:oid] ",  
"BKCdensebat;"  ]
-[ 9@0, "delete",   "command",  "bat",  "(b:bat[:any_1]):bat[:any_1] ", 
"BKCdelete_all;"]
-[ 10@0,"densebat", "command",  "bat",  "(b:bat[:any_1], 
d:bat[:oid]):bat[:any_1] ","BKCdelete_multi;"  ]
-[ 11@0,"diffcand", "command", 

MonetDB: Nov2019 - Properly associate the different parts of MAL...

2019-12-03 Thread Sjoerd Mullender
Changeset: f9338043464e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f9338043464e
Modified Files:
monetdb5/modules/mal/Tests/inspect05.malC
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
Branch: Nov2019
Log Message:

Properly associate the different parts of MAL function definitions.


diffs (287 lines):

diff --git a/monetdb5/modules/mal/Tests/inspect05.malC 
b/monetdb5/modules/mal/Tests/inspect05.malC
--- a/monetdb5/modules/mal/Tests/inspect05.malC
+++ b/monetdb5/modules/mal/Tests/inspect05.malC
@@ -1,17 +1,17 @@
 #Illustrate the modules loaded after start
 m:= inspect.getModule();
 m0:= algebra.select(m,nil:bat[:oid],"bat", "bat", true,true,false);# limit 
the list
-m1:= algebra.projection(m0,m);
 k:= inspect.getKind();
-k0:= algebra.projection(m0,k);
 f:= inspect.getFunction();
+s:= inspect.getSignatures();
+a:= inspect.getAddresses();
+
 f0:= algebra.projection(m0,f);
-s:= inspect.getSignatures();
-s0:= algebra.projection(m0,s);
-a:= inspect.getAddresses();
-a0:= algebra.projection(m0,a);
-
 (fv,forder):= algebra.sort(f0,false,false,true);
 
+m1:= algebra.projectionpath(forder,m0,m);
+k0:= algebra.projectionpath(forder,m0,k);
+s0:= algebra.projectionpath(forder,m0,s);
+a0:= algebra.projectionpath(forder,m0,a);
+
 io.print(fv,k0,m1,s0,a0);
-
diff --git a/monetdb5/modules/mal/Tests/inspect05.stable.out 
b/monetdb5/modules/mal/Tests/inspect05.stable.out
--- a/monetdb5/modules/mal/Tests/inspect05.stable.out
+++ b/monetdb5/modules/mal/Tests/inspect05.stable.out
@@ -29,46 +29,46 @@ stdout of test 'inspect05` in directory 
 # str  str str str str  # type
 #--#
 [ 0@0, "append",   "command",  "bat",  "(i:bat[:any_1], 
u:any_1):bat[:any_1] ","BKCappend_val_wrap;"   ]
-[ 1@0, "append",   "command",  "bat",  "(tt:int, 
heapfile:str):bat[:any_1] ",  "BKCattach;"]
-[ 2@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:any_1, 
force:bit):bat[:any_1] ", "BKCappend_val_force_wrap;" ]
-[ 3@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid], force:bit):bat[:any_1] ",  "BKCappend_cand_force_wrap;"]
-[ 4@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid]):bat[:any_1] ", "BKCappend_cand_wrap;"  ]
-[ 5@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
force:bit):bat[:any_1] ",   "BKCappend_force_wrap;" ]
-[ 6@0, "attach",   "command",  "bat",  "(i:bat[:any_1], 
u:bat[:any_1]):bat[:any_1] ",  "BKCappend_wrap;"   ]
-[ 7@0, "delete",   "command",  "bat",  "(a:bat[:oid], 
b:bat[:oid]):bat[:oid] ","BKCdiffcand;"  ]
-[ 8@0, "delete",   "command",  "bat",  "(sz:lng):bat[:oid] ",  
"BKCdensebat;"  ]
-[ 9@0, "delete",   "command",  "bat",  "(b:bat[:any_1]):bat[:any_1] ", 
"BKCdelete_all;"]
-[ 10@0,"densebat", "command",  "bat",  "(b:bat[:any_1], 
d:bat[:oid]):bat[:any_1] ","BKCdelete_multi;"  ]
-[ 11@0,"diffcand", "command",  "bat",  "(b:bat[:any_1], 
h:oid):bat[:any_1] ",  "BKCdelete;"]
-[ 12@0,"getAccess","pattern",  "bat",  
"(bv:bat[:any_1]):bat[:oid] ",  "OIDXgetorderidx;"  ]
-[ 13@0,"getCapacity",  "command",  "bat",  "(b:bat[:any_1]):str ", 
"BKCgetBBPname;"]
-[ 14@0,"getColumnType","command",  "bat",  
"(b:bat[:any_1]):oid ", "BKCgetSequenceBase;"   ]
-[ 15@0,"getName",  "command",  "bat",  "(b:bat[:any_1]):str ", 
"BKCgetAccess;" ]
+[ 1@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:any_1, 
force:bit):bat[:any_1] ", "BKCappend_val_force_wrap;" ]
+[ 2@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid], force:bit):bat[:any_1] ",  "BKCappend_cand_force_wrap;"]
+[ 3@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
s:bat[:oid]):bat[:any_1] ", "BKCappend_cand_wrap;"  ]
+[ 4@0, "append",   "command",  "bat",  "(i:bat[:any_1], u:bat[:any_1], 
force:bit):bat[:any_1] ",   "BKCappend_force_wrap;" ]
+[ 5@0, "append",   "command",  "bat",  "(i:bat[:any_1], 
u:bat[:any_1]):bat[:any_1] ",  "BKCappend_wrap;"   ]
+[ 6@0, "attach",   "command",  "bat",  "(tt:int, 
heapfile:str):bat[:any_1] ",  "BKCattach;"]
+[ 7@0, "delete",   "command",  "bat",  "(b:bat[:any_1]):bat[:any_1] ", 
"BKCdelete_all;"]
+[ 8@0, "delete",   "command",  "bat",  "(b:bat[:any_1], 
d:bat[:oid]):bat[:any_1] ","BKCdelete_multi;"  ]
+[ 9@0, "delete",   "command",  "bat",  "(b:bat[:any_1], 
h:oid):bat[:any_1] ",  "BKCdelete;"]
+[ 10@0,"densebat", "command",  "bat",  "(sz:lng):bat[:oid] ",  
"BKCdensebat;"  ]
+[ 11@0,"diffcand", "command",  "bat",  "(a:bat[:oid], 
b:bat[:oid]):bat[:oid] ",

MonetDB: default - Removed the tunique property since it wasn't ...

2019-12-03 Thread Sjoerd Mullender
Changeset: 9097e3be6c63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9097e3be6c63
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
gdk/ChangeLog
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/ChangeLog
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/bat5.h
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/Tests/inspect05.stable.out
monetdb5/modules/mal/Tests/inspect05.stable.out.int128
sql/backends/monet5/sql_statement.c
Branch: default
Log Message:

Removed the tunique property since it wasn't used.


diffs (truncated from 449 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -681,7 +681,6 @@ stdout of test 'MAL-signatures` in direc
 [ "bat",   "setColumn","command bat.setColumn(b:bat[:any_1], 
t:str):void ","BKCsetColumn;","Give a logical name to the tail 
column of a BAT."  ]
 [ "bat",   "setHash",  "command bat.setHash(b:bat[:any_1]):bit ",  
"BKCsetHash;",  "Create a hash structure on the column" ]
 [ "bat",   "setImprints",  "command bat.setImprints(b:bat[:any_1]):bit ",  
"BKCsetImprints;",  "Create an imprints structure on the column"]
-[ "bat",   "setKey",   "command bat.setKey(b:bat[:any_1], 
mode:bit):bat[:any_1] ", "BKCsetkey;",   "Sets the 'key' property of the 
tail column to 'mode'. In 'key' mode,\nthe kernel will silently block 
insertions that cause a duplicate\nentry in the head column." ]
 [ "bat",   "setName",  "command bat.setName(b:bat[:any_1], s:str):void 
",  "BKCsetName;",  "Give a logical name to a BAT. "]
 [ "bat",   "setPersistent","command 
bat.setPersistent(b:bat[:any_1]):void ",   "BKCsetPersistent;","Make 
the BAT persistent."  ]
 [ "bat",   "setTransient", "command bat.setTransient(b:bat[:any_1]):void 
","BKCsetTransient;", "Make the BAT transient.  Returns \n\tboolean 
which indicates if the\nBAT administration has indeed changed."   ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -787,7 +787,6 @@ stdout of test 'MAL-signatures` in direc
 [ "bat",   "setColumn","command bat.setColumn(b:bat[:any_1], 
t:str):void ","BKCsetColumn;","Give a logical name to the tail 
column of a BAT."  ]
 [ "bat",   "setHash",  "command bat.setHash(b:bat[:any_1]):bit ",  
"BKCsetHash;",  "Create a hash structure on the column" ]
 [ "bat",   "setImprints",  "command bat.setImprints(b:bat[:any_1]):bit ",  
"BKCsetImprints;",  "Create an imprints structure on the column"]
-[ "bat",   "setKey",   "command bat.setKey(b:bat[:any_1], 
mode:bit):bat[:any_1] ", "BKCsetkey;",   "Sets the 'key' property of the 
tail column to 'mode'. In 'key' mode,\nthe kernel will silently block 
insertions that cause a duplicate\nentry in the head column." ]
 [ "bat",   "setName",  "command bat.setName(b:bat[:any_1], s:str):void 
",  "BKCsetName;",  "Give a logical name to a BAT. "]
 [ "bat",   "setPersistent","command 
bat.setPersistent(b:bat[:any_1]):void ",   "BKCsetPersistent;","Make 
the BAT persistent."  ]
 [ "bat",   "setTransient", "command bat.setTransient(b:bat[:any_1]):void 
","BKCsetTransient;", "Make the BAT transient.  Returns \n\tboolean 
which indicates if the\nBAT administration has indeed changed."   ]
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -856,7 +856,6 @@ str BKCsetImprints(bit *ret, const bat *
 str BKCsetName(void *r, const bat *bid, const char *const *s);
 str BKCsetPersistent(void *r, const bat *bid);
 str BKCsetTransient(void *r, const bat *bid);
-str BKCsetkey(bat *res, const bat *bid, const bit *param);
 str BKCshrinkBAT(bat *ret, const bat *bid, const bat *did);
 str BLOBblob_blob(blob **d, blob **s);
 str BLOBblob_fromstr(blob **b, const char **d);
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -1,6 +1,11 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Tue Dec  3 2019 Sjoerd Mullender 
+- Removed the tunique property.  The tunique property indicated that
+  all values in the column had to be distinct.  It was removed because
+  it wasn't used.
+
 * Fri Nov 22 2019 Sjoerd Mullender 
 - BATrangeselect now has two extra arguments: anti and symmetric
   

MonetDB: default - Remove the middle man.

2019-12-03 Thread Sjoerd Mullender
Changeset: 860e79c124e0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=860e79c124e0
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/modules/kernel/bat5.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_table.c
Branch: default
Log Message:

Remove the middle man.
Removed function void_replace_bat, and call BUNinplace directly
instead of void_inplace which calls BUNinplace.


diffs (192 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -484,7 +484,6 @@ size_t strLen(const char *s);
 int strNil(const char *s);
 const char str_nil[2];
 gdk_return void_inplace(BAT *b, oid id, const void *val, bool force) 
__attribute__((__warn_unused_result__));
-gdk_return void_replace_bat(BAT *b, BAT *p, BAT *u, bool force) 
__attribute__((__warn_unused_result__));
 int win_mkdir(const char *, const int mode);
 int win_rename(const char *, const char *);
 int win_rmdir(const char *);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2284,8 +2284,6 @@ gdk_export void GDKclrerr(void);
 #include "gdk_utils.h"
 
 /* functions defined in gdk_bat.c */
-gdk_export gdk_return void_replace_bat(BAT *b, BAT *p, BAT *u, bool force)
-   __attribute__((__warn_unused_result__));
 gdk_export gdk_return void_inplace(BAT *b, oid id, const void *val, bool force)
__attribute__((__warn_unused_result__));
 gdk_export BAT *BATattach(int tt, const char *heapfile, role_t role);
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1440,22 +1440,6 @@ void_inplace(BAT *b, oid id, const void 
return BUNinplace(b, id - b->hseqbase, val, force);
 }
 
-gdk_return
-void_replace_bat(BAT *b, BAT *p, BAT *u, bool force)
-{
-   BUN r, s;
-   BATiter uvi = bat_iterator(u);
-
-   BATloop(u, r, s) {
-   oid updid = BUNtoid(p, r);
-   const void *val = BUNtail(uvi, r);
-
-   if (void_inplace(b, updid, val, force) != GDK_SUCCEED)
-   return GDK_FAIL;
-   }
-   return GDK_SUCCEED;
-}
-
 /*
  * @- BUN Lookup
  * Location of a BUN using a value should use the available indexes to
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -881,11 +881,28 @@ BATdel(BAT *b, BAT *d)
 gdk_return
 BATreplace(BAT *b, BAT *p, BAT *n, bool force)
 {
-   if (b == NULL || p == NULL || n == NULL || BATcount(n) == 0) {
+   BUN r, s;
+   BATiter nvi = bat_iterator(n);
+   oid hseqend;
+
+   if (b == NULL || b->ttype == TYPE_void ||
+   p == NULL || n == NULL || BATcount(n) == 0) {
return GDK_SUCCEED;
}
-   if (void_replace_bat(b, p, n, force) != GDK_SUCCEED)
-   return GDK_FAIL;
+   hseqend = b->hseqbase + BATcount(b);
+   BATloop(n, r, s) {
+   oid updid = BUNtoid(p, r);
+   const void *val = BUNtail(nvi, r);
+
+   if (b->tunique && BUNfnd(b, val) != BUN_NONE)
+   continue;
+   if (updid < b->hseqbase || updid >= hseqend) {
+   GDKerror("BATreplace: id out of range\n");
+   return GDK_FAIL;
+   }
+   if (BUNinplace(b, updid - b->hseqbase, val, force) != 
GDK_SUCCEED)
+   return GDK_FAIL;
+   }
return GDK_SUCCEED;
 }
 
diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -413,7 +413,7 @@ BKCbat_inplace_force(bat *r, const bat *
BBPunfix(p->batCacheid);
throw(MAL, "bat.inplace", SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
}
-   if (void_replace_bat(b, p, u, *force) != GDK_SUCCEED) {
+   if (BATreplace(b, p, u, *force) != GDK_SUCCEED) {
BBPunfix(b->batCacheid);
BBPunfix(p->batCacheid);
BBPunfix(u->batCacheid);
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
@@ -177,7 +177,7 @@ delta_bind_bat( sql_delta *bat, int acce
bat_destroy(o);
if (nui == NULL ||
nuv == NULL ||
-   void_replace_bat(b, nui, nuv, true) != 
GDK_SUCCEED) {
+   BATreplace(b, nui, nuv, true) != 
GDK_SUCCEED) {
bat_destroy(nui);
bat_destroy(nuv);
bat_destroy(b);
@@ -281,7 +281,7 @@ delta_update_bat( sql_delta *bat, BAT *t
return LOG_ERR;
   

MonetDB: default - TOPN_INCLUDING flag is no longer used

2019-12-03 Thread Pedro Ferreira
Changeset: 51d9c5e15db6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=51d9c5e15db6
Modified Files:
sql/include/sql_relation.h
Branch: default
Log Message:

TOPN_INCLUDING flag is no longer used


diffs (16 lines):

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
@@ -51,11 +51,9 @@ typedef struct expression {
 
 #define EXP_DISTINCT   1
 #define NO_NIL 2
-#define TOPN_INCLUDING 4
+#define LEFT_JOIN  4
 #define ZERO_IF_EMPTY  8
 
-#define LEFT_JOIN  4
-
 /* ASCENDING > 15 else we have problems with cmp types */
 #define ASCENDING  16
 #define CMPMASK(ASCENDING-1)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Moved rewrite_empty_project after rewrite_gro...

2019-12-03 Thread Pedro Ferreira
Changeset: 54cf697b5e7d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=54cf697b5e7d
Modified Files:
sql/include/sql_relation.h
sql/server/rel_optimizer.c
sql/server/rel_unnest.c
Branch: default
Log Message:

Moved rewrite_empty_project after rewrite_groupings at rel_unnest, so empty 
group relations get to project at least an expression always. The 
GROUPING_TOTALS flag is now obsolete


diffs (76 lines):

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
@@ -50,7 +50,7 @@ typedef struct expression {
 } sql_exp;
 
 #define EXP_DISTINCT   1
-#define NO_NIL 2
+#define NO_NIL 2
 #define TOPN_INCLUDING 4
 #define ZERO_IF_EMPTY  8
 
@@ -62,13 +62,11 @@ typedef struct expression {
 #define get_cmp(e) (e->flag)
 #define HAS_NO_NIL 32
 #define NULLS_LAST 64
-#define GROUPING_TOTALS128
 
-#define UPD_COMP   1
-#define UPD_LOCKED 2
+#define UPD_COMP   1
+#define UPD_LOCKED 2
 #define UPD_NO_CONSTRAINT  4
-
-#define REL_PARTITION  8
+#define REL_PARTITION  8
 
 /* We need bit wise exclusive numbers as we merge the level also in the flag */
 #define PSM_SET 1
@@ -284,11 +282,6 @@ typedef enum operator_type {
 #define set_nodistinct(e) \
e->flag &= (~EXP_DISTINCT)
 
-#define set_grouping_totals(e) \
-   e->flag |= GROUPING_TOTALS
-#define is_grouping_totals(e) \
-   ((e->flag_TOTALS)==GROUPING_TOTALS)
-
 #define is_processed(rel) \
((rel)->processed)
 #define set_processed(rel) \
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
@@ -1456,7 +1456,7 @@ project_unsafe(sql_rel *rel, int allow_i
sql_rel *sub = rel->l;
node *n;
 
-   if (need_distinct(rel) || rel->r /* order by */ || 
is_grouping_totals(rel))
+   if (need_distinct(rel) || rel->r /* order by */)
return 1;
if (!rel->exps)
return 0;
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -2565,7 +2565,6 @@ rewrite_groupings(mvc *sql, sql_rel *rel
}
nrel->exps = exps;
nrel = rel_project(sql->sa, nrel, pexps);
-   set_grouping_totals(nrel);
 
if (!unions)
unions = nrel;
@@ -2632,10 +2631,10 @@ rel_unnest(mvc *sql, sql_rel *rel)
rel = rel_exp_visitor(sql, rel, _ifthenelse);   /* add isnull 
handling */
rel = rel_exp_visitor(sql, rel, _exp_rel);
rel = rel_visitor(sql, rel, _compare_exp);  /* only allow 
for e_cmp in selects and  handling */
-   rel = rel_visitor(sql, rel, _empty_project);
rel = _rel_unnest(sql, rel);
rel = rel_visitor(sql, rel, _fix_count);/* fix count 
inside a left join (adds a project (if (cnt IS null) then (0) else (cnt)) */
rel = rel_visitor(sql, rel, _remove_xp);/* remove 
crossproducts with project [ atom ] */
rel = rel_visitor(sql, rel, _groupings);/* transform 
group combinations into union of group relations */
+   rel = rel_visitor(sql, rel, _empty_project);
return rel;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: gdk_tracer - Initialize log levels in preprocessor

2019-12-03 Thread Thodoris Zois
Changeset: 72761bfeb2b8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=72761bfeb2b8
Modified Files:
gdk/gdk_tracer.c
gdk/gdk_tracer.h
Branch: gdk_tracer
Log Message:

Initialize log levels in preprocessor


diffs (87 lines):

diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c
--- a/gdk/gdk_tracer.c
+++ b/gdk/gdk_tracer.c
@@ -27,6 +27,7 @@
 
 #include "monetdb_config.h"
 #include "gdk.h"
+#include "gdk_tracer.h"
 
 // We need to get rid of macros defined in gdk.h. Those are using GDKtracer in 
order to produce 
 // messages. At the point malloc is called in gdk_tracer.c (in function 
_GDKtracer_fill_tracer)
@@ -48,7 +49,8 @@ static FILE *output_file;
 static ATOMIC_TYPE CUR_ADAPTER = DEFAULT_ADAPTER;
 
 static LOG_LEVEL CUR_FLUSH_LEVEL = DEFAULT_FLUSH_LEVEL;
-LOG_LEVEL LVL_PER_COMPONENT[COMPONENTS_COUNT];
+// LOG_LEVEL LVL_PER_COMPONENT[COMPONENTS_COUNT] = {[0 ... COMPONENTS_COUNT-1] 
= DEFAULT_LOG_LEVEL};
+
 static bool GDK_TRACER_STOP = false;
 
 static const char *LAYER_STR[] = {
@@ -59,6 +61,10 @@ static const char *ADAPTER_STR[] = {
 FOREACH_ADPTR(GENERATE_STRING)
 };
 
+LOG_LEVEL LVL_PER_COMPONENT[] = {
+FOREACH_COMP(GENERATE_LOG_LEVEL)
+};
+
 
 // Output error from snprintf of vsnprintf
 static void 
@@ -91,16 +97,6 @@ static void
 }
 
 
-static void
-_GDKtracer_init_components(void)
-{
-for(int i = 0; i < COMPONENTS_COUNT; i++)
-{
-LVL_PER_COMPONENT[i] = DEFAULT_LOG_LEVEL;
-}
-}
-
-
 static bool
 _GDKtracer_adapter_exists(int *adapter)
 {
@@ -273,7 +269,6 @@ GDKtracer_get_timestamp(char* fmt)
 gdk_return
 GDKtracer_init(void)
 {
-_GDKtracer_init_components();
 _GDKtracer_create_file();
 return GDK_SUCCEED;
 }
diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h
--- a/gdk/gdk_tracer.h
+++ b/gdk/gdk_tracer.h
@@ -13,7 +13,7 @@
 #define BUFFER_SIZE 64000
 
 #define DEFAULT_ADAPTER BASIC
-#define DEFAULT_LOG_LEVEL M_CRITICAL
+#define DEFAULT_LOG_LEVEL M_DEBUG
 #define DEFAULT_FLUSH_LEVEL M_INFO
 
 #define FILE_NAME "trace"
@@ -25,7 +25,7 @@
 
 #define GENERATE_ENUM(ENUM) ENUM,
 #define GENERATE_STRING(STRING) #STRING,
-
+#define GENERATE_LOG_LEVEL(COMP) DEFAULT_LOG_LEVEL,
 
 
 // ADAPTERS
@@ -197,7 +197,7 @@ static const char *COMPONENT_STR[] = {
 /*
  * Logging macros 
  */
-extern LOG_LEVEL LVL_PER_COMPONENT[COMPONENTS_COUNT];
+extern LOG_LEVEL LVL_PER_COMPONENT[];
 
 // If the LOG_LEVEL of the message is one of the following: CRITICAL, ERROR or 
WARNING 
 // it is logged no matter the component. In any other case the component is 
taken into account (needs fix)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - Don't include fits.mal in monetdb5-server pac...

2019-12-03 Thread Sjoerd Mullender
Changeset: 302e85949ac8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=302e85949ac8
Modified Files:
debian/monetdb5-server.install
Branch: Nov2019
Log Message:

Don't include fits.mal in monetdb5-server package.
This should fix bug 6794.


diffs (24 lines):

diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,16 +1,17 @@
 debian/tmp/usr/bin/mserver5 usr/bin
 debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so.* usr/lib/x86_64-linux-gnu
 
-# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{bam,geom,gsl,lidar,pyapi,rapi,sql}.so
+# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{bam,fits,geom,gsl,lidar,pyapi*,rapi,sql}.so
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_capi.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_generator.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_opt_sql_append.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_udf.so 
usr/lib/x86_64-linux-gnu/monetdb5
 
-# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT: 
{bam,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bglprsu]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
+# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT: 
{bam,fits,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bfglprsu]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/ba[!m]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/b[!a]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/f[!i]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/generator.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/g[!es]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/l[!i]*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Window function call with subqueries crashing

2019-12-03 Thread Pedro Ferreira
Changeset: bcb7c0fc067d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bcb7c0fc067d
Modified Files:
sql/test/subquery/Tests/subquery3.sql
Branch: default
Log Message:

Window function call with subqueries crashing


diffs (18 lines):

diff --git a/sql/test/subquery/Tests/subquery3.sql 
b/sql/test/subquery/Tests/subquery3.sql
--- a/sql/test/subquery/Tests/subquery3.sql
+++ b/sql/test/subquery/Tests/subquery3.sql
@@ -291,6 +291,14 @@ SELECT
 (SELECT SUM(t1.col1) OVER (PARTITION BY (VALUES(1)) ROWS UNBOUNDED 
PRECEDING) FROM tbl_ProductSales)
 FROM another_T t1; --error, subqueries not allowed inside PARTITION BY
 
+SELECT
+(SELECT SUM(t1.col1) OVER (ORDER BY (VALUES(1)) ROWS UNBOUNDED PRECEDING) 
FROM tbl_ProductSales)
+FROM another_T t1;
+
+SELECT
+(SELECT SUM(t1.col1) OVER (ORDER BY (SELECT SUM(t1.col1 + t2.col1) FROM 
another_T t2) ROWS UNBOUNDED PRECEDING) FROM tbl_ProductSales)
+FROM another_T t1;
+
 /* We shouldn't allow the following internal functions/procedures to be called 
from regular queries */
 --SELECT "identity"(col1) FROM another_T;
 --SELECT "rowid"(col1) FROM another_T;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - New sqlsmith crash

2019-12-03 Thread Pedro Ferreira
Changeset: aba64c6c1c1d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aba64c6c1c1d
Modified Files:
sql/test/mergetables/Tests/sqlsmith-exists.sql
Branch: default
Log Message:

New sqlsmith crash


diffs (41 lines):

diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.sql 
b/sql/test/mergetables/Tests/sqlsmith-exists.sql
--- a/sql/test/mergetables/Tests/sqlsmith-exists.sql
+++ b/sql/test/mergetables/Tests/sqlsmith-exists.sql
@@ -199,4 +199,37 @@ FROM   (SELECT ref_0.function_type_name 
   ON ( subq_1.c0 IS NULL ) 
 WHERE  subq_0.c0 IS NOT NULL;
 
+select 
+ subq_0.c0 as c0, 
+ subq_0.c0 as c1, 
+ cast(coalesce(4,
+ subq_0.c0) as int) as c2, 
+ case when subq_0.c0 is null then subq_0.c0 else subq_0.c0 end
+ as c3, 
+ subq_0.c0 as c4, 
+ subq_0.c0 as c5, 
+ subq_0.c0 as c6, 
+ subq_0.c0 as c7
+from 
+ (select 
+ ref_4.type as c0
+ from 
+ sys.storagemodel as ref_0
+ right join sys.triggers as ref_1
+ right join sys.environment as ref_2
+ on (exists (
+ select 
+ ref_2.name as c0, 
+ ref_2.value as c1
+ from 
+ sys.dependency_owners_on_schemas as ref_3
+ where ref_1.table_id is null))
+ on (ref_0.type = ref_2.name )
+ inner join sys.idxs as ref_4
+ on (ref_1.time is not null)
+ where true) as subq_0
+where subq_0.c0 is not null
+limit 107
+;
+
 ROLLBACK;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list