MonetDB: default - don't require sphinx, just don't build docume...

2020-06-17 Thread Niels Nes
Changeset: 432037504733 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=432037504733
Modified Files:
documentation/CMakeLists.txt
Branch: default
Log Message:

don't require sphinx, just don't build documentation


diffs (9 lines):

diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt
--- a/documentation/CMakeLists.txt
+++ b/documentation/CMakeLists.txt
@@ -1,4 +1,4 @@
-find_package(Sphinx REQUIRED)
+find_package(Sphinx)
  
 if(SPHINX_EXECUTABLE) 
   if(NOT DEFINED SPHINX_THEME)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - fxed literal

2020-06-17 Thread Niels Nes
Changeset: 670929ac for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=670929ac
Modified Files:
documentation/monetdbe/introduction.rst
Branch: default
Log Message:

fxed literal


diffs (18 lines):

diff --git a/documentation/monetdbe/introduction.rst 
b/documentation/monetdbe/introduction.rst
--- a/documentation/monetdbe/introduction.rst
+++ b/documentation/monetdbe/introduction.rst
@@ -7,10 +7,10 @@ this available as a single ``libmonetdbe
 can be directly linked with a C application to benefit from the
 functionality.
 
-``An embedded database system is a database management system (DBMS) which ``
-``is tightly integrated with an application software that requires access to 
stored data, ``
-``such that the database system is "hidden" from the application’s end-user ``
-``and requires little or no ongoing maintenance.`` `wikipedia 
`
+``An embedded database system is a database management system (DBMS) which
+is tightly integrated with an application software that requires access to 
stored data,
+such that the database system is "hidden" from the application’s end-user
+and requires little or no ongoing maintenance.`` `wikipedia 
`
 
 The embedded database market has for a long time been dominated by traditional 
row-stores, 
 often with limited SQL functionality, scalability or performance. 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - solved some more sphinx errors

2020-06-17 Thread Niels Nes
Changeset: 65d8152b1f8d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=65d8152b1f8d
Removed Files:
documentation/monetdbe/index.rst
documentation/source/index.rst
Modified Files:
documentation/conf.py.in
documentation/monetdbe/introduction.rst
Branch: default
Log Message:

solved some more sphinx errors


diffs (99 lines):

diff --git a/documentation/conf.py.in b/documentation/conf.py.in
--- a/documentation/conf.py.in
+++ b/documentation/conf.py.in
@@ -48,12 +48,13 @@ master_doc = 'index'
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'alabaster'
-#html_theme = '@SPHINX_THEME@'
+#html_theme = 'alabaster'
+html_theme = '@SPHINX_THEME@'
+html_theme_path = ['@SPHINX_THEME_DIR@']
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-#html_theme_path = ['@SPHINX_THEME_DIR@']
-#htmlhelp_basename = 'YOUR_PROJECT_NAMEdoc'
+#html_static_path = ['_static']
+
+htmlhelp_basename = 'MonetDB'
diff --git a/documentation/monetdbe/index.rst b/documentation/monetdbe/index.rst
deleted file mode 100644
--- a/documentation/monetdbe/index.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-.. monetdbe documentation master file, created by
-   sphinx-quickstart on Wed May 13 12:42:53 2020.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to MonetDBe's documentation!
-=
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Contents:
-
-   introduction
-   installation
-   monetdbe_api
-   examples
-   dev_notes
-   authors
-
-Indices and tables
-==
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
diff --git a/documentation/monetdbe/introduction.rst 
b/documentation/monetdbe/introduction.rst
--- a/documentation/monetdbe/introduction.rst
+++ b/documentation/monetdbe/introduction.rst
@@ -7,10 +7,10 @@ this available as a single ``libmonetdbe
 can be directly linked with a C application to benefit from the
 functionality.
 
-``An embedded database system is a database management system (DBMS) which 
-is tightly integrated with an application software that requires access to 
stored data, 
-such that the database system is "hidden" from the application’s end-user 
-and requires little or no ongoing maintenance. `` `wikipedia 
`
+``An embedded database system is a database management system (DBMS) which ``
+``is tightly integrated with an application software that requires access to 
stored data, ``
+``such that the database system is "hidden" from the application’s end-user ``
+``and requires little or no ongoing maintenance.`` `wikipedia 
`
 
 The embedded database market has for a long time been dominated by traditional 
row-stores, 
 often with limited SQL functionality, scalability or performance. 
diff --git a/documentation/source/index.rst b/documentation/source/index.rst
deleted file mode 100644
--- a/documentation/source/index.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-.. MonetDB documentation master file, created by
-   sphinx-quickstart on Fri Jan 17 16:06:39 2020.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to MonetDB's documentation!
-===
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Contents:
-
-   input
-   json
-   clients
-   manual_pages
-
-
-Indices and tables
-==
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Another pass over the documentation

2020-06-17 Thread Martin Kersten
Changeset: 28f6e11854f6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=28f6e11854f6
Modified Files:
documentation/monetdbe/introduction.rst
documentation/monetdbe/monetdbe_api.rst
Branch: default
Log Message:

Another pass over the documentation


diffs (140 lines):

diff --git a/documentation/monetdbe/introduction.rst 
b/documentation/monetdbe/introduction.rst
--- a/documentation/monetdbe/introduction.rst
+++ b/documentation/monetdbe/introduction.rst
@@ -10,7 +10,7 @@ functionality.
 ``An embedded database system is a database management system (DBMS) which 
 is tightly integrated with an application software that requires access to 
stored data, 
 such that the database system is "hidden" from the application’s end-user 
-and requires little or no ongoing maintenance. `` `[wikipedia] 
https://en.wikipedia.org/wiki/Embedded_database`_
+and requires little or no ongoing maintenance. `` `wikipedia 
`
 
 The embedded database market has for a long time been dominated by traditional 
row-stores, 
 often with limited SQL functionality, scalability or performance. 
@@ -27,7 +27,7 @@ data analytics and machine learning, wit
 A strong embeddedness with the application to easily use the UDFs at close 
range without overhead in data exchanges.
 
 How we solved it

+
 
 The solution brought to you is illustrated below. On the left we see MonetDB 
in 
 the role of a client/server architecture as it has worked all along. 
@@ -56,7 +56,8 @@ A single library to be linked into the a

 
 How does it work?
-
+-
+
 MonetDBe encapsulates the full SQL functionality offered by MonetDB. 
 To achieve this, we had to create a single shared library (libmonetdbe) to 
 expose the main sql interfaces using a small api (monetdbe.h). 
@@ -64,6 +65,7 @@ It is an integral component of the serve
 
 What to expect?
 ---
+
 The MonetDBe library supports three different storage schemes. 
 A light-weight scheme for small databases confined to main memory, i.e. 
connect(‘ :inmemory:’). 
 The maximum footprint can be set explicitly or is derived from the host (VM) 
resource limits. 
diff --git a/documentation/monetdbe/monetdbe_api.rst 
b/documentation/monetdbe/monetdbe_api.rst
--- a/documentation/monetdbe/monetdbe_api.rst
+++ b/documentation/monetdbe/monetdbe_api.rst
@@ -7,7 +7,7 @@ error messages encountered during the in
 exception message thrown by the MonetDB kernel.
 
 General considerations
--
+--
 
 There can be a single :memory: database or local persistent database open at a 
time. As soon as you open another database its
 content is gone. It is possible to have multiple connections open with 
full-fledge MonetDB servers.
@@ -17,25 +17,23 @@ Data Types
 
 The API wraps the internal data types to those more convenient for programming 
directly in C.
 
-
 | MonetDBe type   | MonetDB internal type |
 | --- | - |
-|int8_t  |  bool|
-|int8_t  |  int8_t|
-|int16_t  |  int16_t|
-|int32_t  |  int32_t|
-|int64_t  |  int64_t|
-|__int128  |  int128_t|
-|float  |  float|
-|double  |  double|
-|char *  |  str|
-|monetdbe_data_blob  |  blob|
-|monetdbe_data_date  |  date|
-|monetdbe_data_time  |  time|
-|monetdbe_data_timestamp  |  timestamp|
+| int8_t  |  bool|
+| int8_t  |  int8_t|
+| int16_t  |  int16_t|
+| int32_t  |  int32_t|
+| int64_t  |  int64_t|
+| __int128  |  int128_t|
+| float  |  float|
+| double  |  double|
+| char *  |  str|
+| monetdbe_data_blob  |  blob|
+| monetdbe_data_date  |  date|
+| monetdbe_data_time  |  time|
+| monetdbe_data_timestamp  |  timestamp|
 | --- | - |
 
-
 Connection and server options
 -
 
@@ -53,7 +51,6 @@ Connection and server options
 From here on the connection can not be used anymore to pass queries and 
any pending result set is cleaned up.
 Be aware that the content of an ':memory:' database is discarded.
 
-
 Transaction management
 --
 
@@ -108,22 +105,20 @@ Query prepare, bind, execute
 
 Remove the execution pland and all bound variables.
 
-
 Database append
---
+-=-
 
 .. c:function:: char* monetdbe_append(monetdbe_database db, const char* 
schema, const char* table, monetdbe_result *result, size_t column_count);
 
 The result set obtained from any query can be assigned to a new database 
table. 
 
-
 Backup and restore
 --
 .. c:function:: char* monetdbe_backup(monetdbe_database db, char *backupfile);
 
 [TODO] Dump a :memory: database as a collection of SQL statements on a 
local file
 
-.. c:function:: monetdbe_export char* monetdbe_dump_table(monetdbe_database 
db, const char *schema_name, const char *table_name, const char *backupfile);
+.. c:function:: char* monetdbe_dump_table(monetdbe_database 

MonetDB: default - don't build documentation if sphinx_executabl...

2020-06-17 Thread Niels Nes
Changeset: 4797e757d2e4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4797e757d2e4
Modified Files:
documentation/CMakeLists.txt
Branch: default
Log Message:

don't build documentation if sphinx_executable is missing


diffs (50 lines):

diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt
--- a/documentation/CMakeLists.txt
+++ b/documentation/CMakeLists.txt
@@ -1,28 +1,29 @@
 find_package(Sphinx REQUIRED)
  
-if(NOT DEFINED SPHINX_THEME)
+if(SPHINX_EXECUTABLE) 
+  if(NOT DEFINED SPHINX_THEME)
 set(SPHINX_THEME default)
-endif()
+  endif()
  
-if(NOT DEFINED SPHINX_THEME_DIR)
+  if(NOT DEFINED SPHINX_THEME_DIR)
 set(SPHINX_THEME_DIR)
-endif()
+  endif()
  
-# configured documentation tools and intermediate build results
-set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
+  # configured documentation tools and intermediate build results
+  set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
  
-# Sphinx cache with pickled ReST documents
-set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
+  # Sphinx cache with pickled ReST documents
+  set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
  
-# HTML output directory
-set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
+  # HTML output directory
+  set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
  
-configure_file(
+  configure_file(
 "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
 "${BINARY_BUILD_DIR}/conf.py"
 @ONLY)
  
-add_custom_target(documentation ALL
+  add_custom_target(documentation ALL
 ${SPHINX_EXECUTABLE}
 -q -b html
 -c "${BINARY_BUILD_DIR}"
@@ -30,3 +31,4 @@ add_custom_target(documentation ALL
 "${CMAKE_CURRENT_SOURCE_DIR}"
 "${SPHINX_HTML_DIR}"
 COMMENT "Building HTML documentation with Sphinx")
+endif()
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - add missing index file

2020-06-17 Thread Niels Nes
Changeset: 279229e6ac6b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=279229e6ac6b
Added Files:
documentation/index.rst
Branch: default
Log Message:

add missing index file


diffs (26 lines):

diff --git a/documentation/index.rst b/documentation/index.rst
new file mode 100644
--- /dev/null
+++ b/documentation/index.rst
@@ -0,0 +1,21 @@
+.. MonetDB documentation master file, created by
+   sphinx-quickstart on Fri Jan 17 16:06:39 2020.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to MonetDB's documentation!
+===
+
+.. toctree::
+   :maxdepth: 3
+   :caption: Contents:
+
+   monetdbe
+   source
+
+Indices and tables
+==
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - mmerged

2020-06-17 Thread Niels Nes
Changeset: e1d0779dc932 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e1d0779dc932
Added Files:
documentation/monetdbe/architecture.png
Modified Files:
documentation/monetdbe/introduction.rst
documentation/monetdbe/monetdbe_api.rst
documentation/source/manual_pages/monetdbd.rst.in
tools/merovingian/daemon/monetdbd.1.in
Branch: default
Log Message:

mmerged


diffs (truncated from 1410 to 300 lines):

diff --git a/documentation/monetdbe/architecture.png 
b/documentation/monetdbe/architecture.png
new file mode 100644
index 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..73a0fed6b460225efe2357f3fa68437c3b938972
GIT binary patch
literal 64520
zc%1CKRal(CvM!7c?!g9k3-0c20RjOA_rcvYxVyV1xH|-Q2<|Sy-3fMBXRW>0UgtlT
z|K<5^y1Tloy6dg4s;lOineZ=4(kO^PLPwRR{>ERtN}46?ni0#Xi4r@MGW&
z78m~_D=tp@#nH|TY;6hwK^t#uU_dYXnReLF(7<4Lf`Jav(M>fhEK1d&tFL>ayN|Tr
zV1P6yO-E-74}Gi8AIrOaup7RB`Q-b!+|7%}Y)PZ{8xB`>x}ydaU&~zpq???j0~<6n
z1zcQqmTFcOlF0$YGT#WSB$dcLGAXFJqX?p32+}0-6C@G5$tGm&EZHdR+wlXcE|>Q)pXWWRNynVvtcqcu`@Dda<{RE_{SsQ
z&iB!^F?BX1b+@s$b>eduB>&$l_&)moATyJb{_iEuR)XZ3ieE^@?Ho->Ihi<^SjdGC
zNl8fs98JvlR3)VT#r`o8B)4#Ow&!DJc5`!Ma${$*b2MjW<>lpNW?^GyV`KbS!RX{+
z>ul)GXzN7rPa*#$N5a&}*b!{+47Rf+{m0nQ$j-%CkevKqYySEC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>B1!uk?YlmO*oqpYv=%P4L$M~s$tHO-9pvnB
zoh~Ynh3_D`DLtc`=of?PlfdEtMj!5Pc$zQrfBB-}w54S5v_s916tIn$x-pPyhv1J|4{``xr%KS{x2_3cIKQ>?sUnRUiOeE_f1}1%>~9?418HJTS(JzgwK+w+
zRnNV-GT{KDbOi4j1I5eNioDWil_+_4ehh#WEwd3)%f1klMa#crOc#=fP)n@s@V+|D
zMm3(46L-M7Y4H%`EE5<3y}$2lg{!
z+UCWR+!l}TnGuHN7tPG@OvkEwM9VSPbc$B?8UvS^7mxSJ)wVAD{WU#Q)
zf}gX_MvEqc$qB*OL39{JeNoyN;qGe1VI{~8Xyq!fnsuO%a92Bb0#H-E&C6lr>8T9W
zv@3qUXKZpyBVp8Sn;Q>FD>iHv8xIE<*%QFIHVBR*UUh{s!jlR+0Q{X)|I*F`Yotd9
zE)8b;hNSZ+QJxlQO*$4`MEDM`!$&h3uM+6sPQx*_1e*`JZ6j72P4C>&3F;grt%
z3qNI#mZ}BcUzkHAb>}pb!7BAV^3_B2^f|rNLy`%mx@9NgGV1j5Ta^wtvy-qYTJQIq
zZCGOC{Da6c&k8As9WPE7jSeP`ER0e*LE+G-Z7JbZ%I2C~nLT)zhlyO7@2JTBdW0r)

MonetDB: default - small change of config file

2020-06-17 Thread Niels Nes
Changeset: 0d61fa843d01 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d61fa843d01
Modified Files:
documentation/conf.py.in
Branch: default
Log Message:

small change of config file


diffs (38 lines):

diff --git a/documentation/conf.py.in b/documentation/conf.py.in
--- a/documentation/conf.py.in
+++ b/documentation/conf.py.in
@@ -16,7 +16,6 @@
 
 
 # -- Project information -
-
 project = 'monetdbe'
 copyright = '2020, MonetDB Solutions'
 author = ''
@@ -34,6 +33,7 @@ extensions = [
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
+#templates_path = '@SPHINX_TEMPLATES@'
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
@@ -43,15 +43,17 @@ exclude_patterns = []
 # This is needed to keep readthedocs happy
 master_doc = 'index'
 
-
 # -- Options for HTML output -
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
 html_theme = 'alabaster'
+#html_theme = '@SPHINX_THEME@'
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
+#html_theme_path = ['@SPHINX_THEME_DIR@']
+#htmlhelp_basename = 'YOUR_PROJECT_NAMEdoc'
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - add documentation generation using sphinx

2020-06-17 Thread Niels Nes
Changeset: 0a5cbf304d2b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a5cbf304d2b
Added Files:
cmake/Modules/FindSphinx.cmake
documentation/CMakeLists.txt
documentation/conf.py.in
Modified Files:
CMakeLists.txt
tools/monetdbe/monetdbe.c
Branch: default
Log Message:

add documentation generation using sphinx


diffs (142 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,6 +177,7 @@ include(monetdb-packages)
 
 include(CTest)
 add_subdirectory(ctest)
+add_subdirectory(documentation)
 
 if(CMAKE_SUMMARY)
   monetdb_cmake_summary()
diff --git a/cmake/Modules/FindSphinx.cmake b/cmake/Modules/FindSphinx.cmake
new file mode 100644
--- /dev/null
+++ b/cmake/Modules/FindSphinx.cmake
@@ -0,0 +1,14 @@
+find_program(SPHINX_EXECUTABLE NAMES sphinx-build
+HINTS
+$ENV{SPHINX_DIR}
+PATH_SUFFIXES bin
+DOC "Sphinx documentation generator"
+)
+ 
+include(FindPackageHandleStandardArgs)
+ 
+find_package_handle_standard_args(Sphinx DEFAULT_MSG
+SPHINX_EXECUTABLE
+)
+ 
+mark_as_advanced(SPHINX_EXECUTABLE)
diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/documentation/CMakeLists.txt
@@ -0,0 +1,32 @@
+find_package(Sphinx REQUIRED)
+ 
+if(NOT DEFINED SPHINX_THEME)
+set(SPHINX_THEME default)
+endif()
+ 
+if(NOT DEFINED SPHINX_THEME_DIR)
+set(SPHINX_THEME_DIR)
+endif()
+ 
+# configured documentation tools and intermediate build results
+set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
+ 
+# Sphinx cache with pickled ReST documents
+set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
+ 
+# HTML output directory
+set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
+ 
+configure_file(
+"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
+"${BINARY_BUILD_DIR}/conf.py"
+@ONLY)
+ 
+add_custom_target(documentation ALL
+${SPHINX_EXECUTABLE}
+-q -b html
+-c "${BINARY_BUILD_DIR}"
+-d "${SPHINX_CACHE_DIR}"
+"${CMAKE_CURRENT_SOURCE_DIR}"
+"${SPHINX_HTML_DIR}"
+COMMENT "Building HTML documentation with Sphinx")
diff --git a/documentation/conf.py.in b/documentation/conf.py.in
new file mode 100644
--- /dev/null
+++ b/documentation/conf.py.in
@@ -0,0 +1,57 @@
+# Configuration file for the Sphinx documentation builder.
+#
+# This file only contains a selection of the most common options. For a full
+# list see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+# -- Path setup --
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+
+# -- Project information -
+
+project = 'monetdbe'
+copyright = '2020, MonetDB Solutions'
+author = ''
+
+# The full version, including alpha/beta/rc tags
+release = '0.1'
+
+# -- General configuration ---
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
+exclude_patterns = []
+
+# This is needed to keep readthedocs happy
+master_doc = 'index'
+
+
+# -- Options for HTML output -
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'alabaster'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -221,6 +221,9 @@ monetdbe_query_internal(monetdbe_databas
bstream *old_bstream = NULL;
stream *fdout = c->fdout;
 
+   if (result)
+   *result = NULL;
+
if ((msg = validate_database_handle(dbhdl, 
"monetdbe.monetdbe_query_internal")) != MAL_SUCCEED)
return msg;
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - Uncommented test query

2020-06-17 Thread Pedro Ferreira
Changeset: 52c5a23c41af for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=52c5a23c41af
Modified Files:
sql/test/SQLancer/Tests/sqlancer01.sql
Branch: Jun2020
Log Message:

Uncommented test query


diffs (12 lines):

diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -316,7 +316,7 @@ START TRANSACTION; -- Bug 6908
 CREATE TABLE t0(c0 BOOLEAN,c1 CHAR(140));
 create view v0(c0) as (select distinct 0.4 from t0 where 
((t0.c0)andlower(t0.c1))||(-69891801)/(1210439951)))+(cast(0.5895729273161221
 as int)) between symmetric (cast(0.3 as string)) and (greatest(t0.c1, 
((t0.c1)||(-2045486895)));
 create view v1(c0) as (select distinct t0.c1 from t0 where t0.c0);
---select max(all abs(+ (- (- (-1620427795) from v0, t0 join v1 on 
v1.c0)||(t0.c1)))ilike(v1.c0));
+select max(all abs(+ (- (- (-1620427795) from v0, t0 join v1 on 
v1.c0)||(t0.c1)))ilike(v1.c0));
 ROLLBACK;
 
 DROP TABLE tbl_ProductSales;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - Fix for SQLancer query, rel_push_func_down op...

2020-06-17 Thread Pedro Ferreira
Changeset: dc0f155969d9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc0f155969d9
Modified Files:
sql/server/rel_exp.c
sql/server/rel_optimizer.c
sql/test/SQLancer/Tests/sqlancer01.sql
sql/test/SQLancer/Tests/sqlancer01.stable.out
Branch: Jun2020
Log Message:

Fix for SQLancer query, rel_push_func_down optimizer could accidentaly push an 
e_cmp into an underlying projection. Fixed the issue by applying optimization 
recursively, ie push down just any expression other than e_cmp


diffs (truncated from 367 to 300 lines):

diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -2054,7 +2054,7 @@ exp_unsafe( sql_exp *e, int allow_identi
 
if (e->type == e_convert && e->l)
return exp_unsafe(e->l, allow_identity);
-   if (e->type == e_func && e->l) {
+   if ((e->type == e_func || e->type == e_aggr) && e->l) {
sql_subfunc *f = e->f;
list *args = e->l;
node *n;
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
@@ -1461,22 +1461,8 @@ exp_push_down(mvc *sql, sql_exp *e, sql_
 }
 
 static int 
-math_unsafe(sql_subfunc *f)
-{
-   if (!f->func->s) {
-   if (strcmp(f->func->base.name, "sql_div") == 0 ||
-   strcmp(f->func->base.name, "sqrt") == 0 ||
-   strcmp(f->func->base.name, "atan") == 0 ) 
-   return 1;
-   }
-   return 0;
-}
-
-static int 
 can_push_func(sql_exp *e, sql_rel *rel, int *must)
 {
-   if (!e)
-   return 0;
switch(e->type) {
case e_cmp: {
int mustl = 0, mustr = 0, mustf = 0;
@@ -1485,24 +1471,21 @@ can_push_func(sql_exp *e, sql_rel *rel, 
if (e->flag == cmp_or || e->flag == cmp_in || e->flag == 
cmp_notin || e->flag == cmp_filter) 
return 0;
return ((l->type == e_column || can_push_func(l, rel, &mustl)) 
&& (*must = mustl)) || 
-  (!f && (r->type == e_column || can_push_func(r, rel, 
&mustr)) && (*must = mustr)) || 
-  (f && 
-  (r->type == e_column || can_push_func(r, rel, &mustr)) 
&& 
-  (f->type == e_column || can_push_func(f, rel, &mustf)) 
&& (*must = (mustr || mustf)));
+   (!f && (r->type == e_column || can_push_func(r, 
rel, &mustr)) && (*must = mustr)) || 
+   (f && 
+   (r->type == e_column || can_push_func(r, rel, 
&mustr)) && 
+   (f->type == e_column || can_push_func(f, rel, &mustf)) 
&& (*must = (mustr || mustf)));
}
case e_convert:
return can_push_func(e->l, rel, must);
+   case e_aggr:
case e_func: {
list *l = e->l;
-   node *n;
int res = 1, lmust = 0;
-   
-   if (e->f){
-   sql_subfunc *f = e->f;
-   if (math_unsafe(f) || f->func->type != F_FUNC)
-   return 0;
-   }
-   if (l) for (n = l->h; n && res; n = n->next)
+
+   if (exp_unsafe(e, 0))
+   return 0;
+   if (l) for (node *n = l->h; n && res; n = n->next)
res &= can_push_func(n->data, rel, &lmust);
if (res && !lmust)
return 1;
@@ -1514,7 +1497,6 @@ can_push_func(sql_exp *e, sql_rel *rel, 
return 0;
(*must) = 1;
/* fall through */
-   case e_atom:
default:
return 1;
}
@@ -1523,15 +1505,13 @@ can_push_func(sql_exp *e, sql_rel *rel, 
 static int
 exps_can_push_func(list *exps, sql_rel *rel) 
 {
-   node *n;
-
-   for(n = exps->h; n; n = n->next) {
+   for(node *n = exps->h; n; n = n->next) {
sql_exp *e = n->data;
int must = 0, mustl = 0, mustr = 0;
 
if (is_joinop(rel->op) && ((can_push_func(e, rel->l, &mustl) && 
mustl) || (can_push_func(e, rel->r, &mustr) && mustr)))
return 1;
-   else if (is_select(rel->op) && can_push_func(e, NULL, &must) && 
must)
+   else if (is_select(rel->op) && can_push_func(e, rel->l, &must) 
&& must)
return 1;
}
return 0;
@@ -1540,8 +1520,6 @@ exps_can_push_func(list *exps, sql_rel *
 static int
 exp_needs_push_down(sql_exp *e)
 {
-   if (!e)
-   return 0;
switch(e->type) {
case e_cmp: 
if (e->flag == cmp_or || e->flag == cmp_in || e->flag == 
cmp_notin || e->flag == cmp_filter) 
@@ -1549,8 +1527,8 @@ exp_needs_push_down(sql_exp *e)
return exp_needs_push_down(e->l) || exp_n

MonetDB: default - Use correct string to be replace by cmake.

2020-06-17 Thread Sjoerd Mullender
Changeset: adbecbe95b9e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=adbecbe95b9e
Modified Files:
documentation/source/manual_pages/monetdbd.rst.in
Branch: default
Log Message:

Use correct string to be replace by cmake.


diffs (12 lines):

diff --git a/documentation/source/manual_pages/monetdbd.rst.in 
b/documentation/source/manual_pages/monetdbd.rst.in
--- a/documentation/source/manual_pages/monetdbd.rst.in
+++ b/documentation/source/manual_pages/monetdbd.rst.in
@@ -141,7 +141,7 @@ using the **set** command. The following
either given as hashed value prefixed by the hash type in curly
braces (e.g. {SHA512}xxx...) or as plain text value which will be
hashed automatically. Note that the only hash accepted is the one
-   specified at configure time, which is @MONETDB5_PASSWDHASH@. Changing
+   specified at configure time, which is @PASSWORD_BACKEND@. Changing
this property takes effect immediately at runtime.
 
 **discovery**
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Use correct string to be replace by cmake.

2020-06-17 Thread Sjoerd Mullender
Changeset: e75721bb2d3a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e75721bb2d3a
Modified Files:
tools/merovingian/daemon/monetdbd.1.in
Branch: default
Log Message:

Use correct string to be replace by cmake.


diffs (12 lines):

diff --git a/tools/merovingian/daemon/monetdbd.1.in 
b/tools/merovingian/daemon/monetdbd.1.in
--- a/tools/merovingian/daemon/monetdbd.1.in
+++ b/tools/merovingian/daemon/monetdbd.1.in
@@ -205,7 +205,7 @@ from a remote machine, a passphrase is n
 The passphrase can be either given as hashed value prefixed by the hash
 type in curly braces (e.g. {SHA512}xxx...) or as plain text value which
 will be hashed automatically.  Note that the only hash accepted is the
-one specified at configure time, which is @MONETDB5_PASSWDHASH@.
+one specified at configure time, which is @PASSWORD_BACKEND@.
 Changing this property takes effect immediately at runtime.
 .TP
 .B discovery
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Another pass over the documentation

2020-06-17 Thread Martin Kersten
Changeset: 043e1693858e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=043e1693858e
Added Files:
documentation/monetdbe/architecture.png
Modified Files:
documentation/monetdbe/introduction.rst
documentation/monetdbe/monetdbe_api.rst
Branch: default
Log Message:

Another pass over the documentation


diffs (truncated from 1386 to 300 lines):

diff --git a/documentation/monetdbe/architecture.png 
b/documentation/monetdbe/architecture.png
new file mode 100644
index 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..73a0fed6b460225efe2357f3fa68437c3b938972
GIT binary patch
literal 64520
zc%1CKRal(CvM!7c?!g9k3-0c20RjOA_rcvYxVyV1xH|-Q2<|Sy-3fMBXRW>0UgtlT
z|K<5^y1Tloy6dg4s;lOineZ=4(kO^PLPwRR{>ERtN}46?ni0#Xi4r@MGW&
z78m~_D=tp@#nH|TY;6hwK^t#uU_dYXnReLF(7<4L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w`*1Kz1v$GiTGrMav~2^9w>)a?$FUnP+MHzoYwzF{E_7t
zfj!IEyoPDpdDhe&A`U&RL?%

MonetDB: default - Get rid of a lot of unneeded exports.

2020-06-17 Thread Sjoerd Mullender
Changeset: 1a8ba4bc0a26 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a8ba4bc0a26
Removed Files:
monetdb5/modules/atoms/json.h
monetdb5/modules/kernel/batcolor.h
monetdb5/modules/mal/json_util.h
Modified Files:
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
monetdb5/mal/mel.h
monetdb5/modules/atoms/CMakeLists.txt
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/color.h
monetdb5/modules/atoms/identifier.c
monetdb5/modules/atoms/inet.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/kernel/CMakeLists.txt
monetdb5/modules/kernel/batcolor.c
monetdb5/modules/mal/CMakeLists.txt
monetdb5/modules/mal/batcalc.c
monetdb5/modules/mal/json_util.c
Branch: default
Log Message:

Get rid of a lot of unneeded exports.


diffs (truncated from 1908 to 300 lines):

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
@@ -12871,10 +12871,12 @@ stdout of test 'MAL-signatures` in direc
 [ "json",  "dump", "pattern json.dump(X_1:json):void ","JSONdump;",
""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:str):json ", 
"JSONfilter;",  ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:bte, 
X_3:str):json ","JSONfilterArrayDefault_bte;",  ""  ]
+[ "json",  "filter",   "command json.filter(X_1:json, X_2:hge, 
X_3:str):json ","JSONfilterArrayDefault_hge;",  ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:int, 
X_3:str):json ","JSONfilterArrayDefault_int;",  ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:lng, 
X_3:str):json ","JSONfilterArrayDefault_lng;",  ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:sht, 
X_3:str):json ","JSONfilterArrayDefault_sht;",  ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:bte):json ", 
"JSONfilterArray_bte;", ""  ]
+[ "json",  "filter",   "command json.filter(X_1:json, X_2:hge):json ", 
"JSONfilterArray_hge;", ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:int):json ", 
"JSONfilterArray_int;", ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:lng):json ", 
"JSONfilterArray_lng;", ""  ]
 [ "json",  "filter",   "command json.filter(X_1:json, X_2:sht):json ", 
"JSONfilterArray_sht;", ""  ]
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
@@ -773,8 +773,6 @@ str AGGRsubvariance_dbl(bat *retval, con
 str AGGRsubvariancecand_dbl(bat *retval, const bat *bid, const bat *gid, const 
bat *eid, const bat *sid, const bit *skip_nils, const bit *abort_on_error);
 str AGGRsubvariancep_dbl(bat *retval, const bat *bid, const bat *gid, const 
bat *eid, const bit *skip_nils, const bit *abort_on_error);
 str AGGRsubvariancepcand_dbl(bat *retval, const bat *bid, const bat *gid, 
const bat *eid, const bat *sid, const bit *skip_nils, const bit 
*abort_on_error);
-str AGGRsubxml(bat *retval, const bat *bid, const bat *gid, const bat *eid, 
const bit *skip_nils);
-str AGGRsubxmlcand(bat *retval, const bat *bid, const bat *gid, const bat 
*eid, const bat *sid, const bit *skip_nils);
 str AGGRsum3_bte(bat *retval, const bat *bid, const bat *gid, const bat *eid);
 str AGGRsum3_dbl(bat *retval, const bat *bid, const bat *gid, const bat *eid);
 str AGGRsum3_flt(bat *retval, const bat *bid, const bat *gid, const bat *eid);
@@ -881,24 +879,6 @@ str BATPCREnotilike(bat *ret, const bat 
 str BATPCREnotilike2(bat *ret, const bat *b, const str *pat);
 str BATPCREnotlike(bat *ret, const bat *b, const str *pat, const str *esc);
 str BATPCREnotlike2(bat *ret, const bat *b, const str *pat);
-str BATXMLattribute(bat *ret, const char *const *name, const bat *bid);
-str BATXMLcomment(bat *ret, const bat *bid);
-str BATXMLconcat(bat *ret, const bat *bid, const bat *rid);
-str BATXMLcontent(bat *ret, const bat *bid);
-str BATXMLdocument(bat *ret, const bat *bid);
-str BATXMLelement(bat *ret, const char *const *name, xml *ns, xml *attr, const 
bat *bid);
-str BATXMLelementSmall(bat *ret, const char *const *name, const bat *bid);
-str BATXMLforest(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
-str BATXMLgroup(xml *ret, const bat *bid);
-str BATXMLisdocument(bat *ret, const bat *bid);
-str BATXMLoptions(bat *ret, const char *const *name, const char *const 
*options, const bat *bid);
-str BATXMLparse(bat *ret, const char *const *doccont, const bat *bid, const 
char *const *option);
-str BA

MonetDB: Jun2020 - Updated test with crashing query

2020-06-17 Thread Pedro Ferreira
Changeset: 216c98d10c03 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=216c98d10c03
Modified Files:
sql/test/SQLancer/Tests/sqlancer01.sql
Branch: Jun2020
Log Message:

Updated test with crashing query


diffs (27 lines):

diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -314,21 +314,9 @@ ROLLBACK;
 
 START TRANSACTION; -- Bug 6908
 CREATE TABLE t0(c0 BOOLEAN,c1 CHAR(140));
-COMMENT ON TABLE "sys"."t0" IS 'Kn䛺䛺r';
-COPY 9 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
-false  "0.6481236457757975-2109927659"
-NULL   "-21099276590.48742518585365991"
-false  NULL
-false  NULL
-false  "heQhWJBhttps://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Reduce exports.

2020-06-17 Thread Sjoerd Mullender
Changeset: 0ae1d2ae7be9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ae1d2ae7be9
Removed Files:
monetdb5/extras/mal_optimizer_template/opt_sql_append.h
Modified Files:
monetdb5/extras/mal_optimizer_template/CMakeLists.txt
monetdb5/extras/mal_optimizer_template/opt_sql_append.c
monetdb5/extras/rapi/rapi.c
monetdb5/extras/rapi/rapi.h
Branch: default
Log Message:

Reduce exports.


diffs (180 lines):

diff --git a/monetdb5/extras/mal_optimizer_template/CMakeLists.txt 
b/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
--- a/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
+++ b/monetdb5/extras/mal_optimizer_template/CMakeLists.txt
@@ -10,8 +10,7 @@ add_library(opt_sql_append MODULE)
 
 target_sources(opt_sql_append
   PRIVATE
-  opt_sql_append.c
-  opt_sql_append.h)
+  opt_sql_append.c)
 
 target_include_directories(opt_sql_append
   PRIVATE
diff --git a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c 
b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
--- a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
+++ b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
@@ -69,7 +69,7 @@
  * This allows the optimizer implementation to find them and react on them.
  */
 #include "monetdb_config.h"
-#include "opt_sql_append.h"
+#include "opt_prelude.h"
 #include "mal_interpreter.h"
 
 /* focus initially on persistent tables. */
@@ -246,7 +246,8 @@ OPTsql_appendImplementation(Client cntxt
  * actions taken, i.e. number of successful changes to the code.
  */
 
-str OPTsql_append(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p){
+static str
+OPTsql_append(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p){
str modnme;
str fcnnme;
str msg= MAL_SUCCEED;
diff --git a/monetdb5/extras/mal_optimizer_template/opt_sql_append.h 
b/monetdb5/extras/mal_optimizer_template/opt_sql_append.h
deleted file mode 100644
--- a/monetdb5/extras/mal_optimizer_template/opt_sql_append.h
+++ /dev/null
@@ -1,26 +0,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 - 2020 MonetDB B.V.
- */
-
-#ifndef _OPT_SQL_APPEND_
-#define _OPT_SQL_APPEND_
-
-#ifdef WIN32
-#ifndef LIBOPT_SQL_APPEND
-#define opt_sql_append_export extern __declspec(dllimport)
-#else
-#define opt_sql_append_export extern __declspec(dllexport)
-#endif
-#else
-#define opt_sql_append_export extern
-#endif
-
-#include "opt_prelude.h"
-
-opt_sql_append_export str OPTsql_append(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr p);
-
-#endif /* _OPT_SQL_APPEND_ */
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -59,14 +59,17 @@ static bool RAPIEnabled(void) {
 // The R-environment should be single threaded, calling for some protective 
measures.
 static MT_Lock rapiLock = MT_LOCK_INITIALIZER("rapiLock");
 static bool rapiInitialized = false;
+#if 0
 static char* rtypenames[] = { "NIL", "SYM", "LIST", "CLO", "ENV", "PROM",
"LANG", "SPECIAL", "BUILTIN", "CHAR", "LGL", "unknown", 
"unknown",
"INT", "REAL", "CPLX", "STR", "DOT", "ANY", "VEC", "EXPR", 
"BCODE",
"EXTPTR", "WEAKREF", "RAW", "S4" };
+#endif
 
 static Client rapiClient = NULL;
 
 
+#if 0
 // helper function to translate R TYPEOF() return values to something readable
 char* rtypename(int rtypeid) {
if (rtypeid < 0 || rtypeid > 25) {
@@ -74,8 +77,9 @@ char* rtypename(int rtypeid) {
} else
return rtypenames[rtypeid];
 }
+#endif
 
-void writeConsoleEx(const char * buf, int buflen, int foo) {
+static void writeConsoleEx(const char * buf, int buflen, int foo) {
(void) buflen;
(void) foo;
(void) buf; // silence compiler
@@ -84,11 +88,11 @@ void writeConsoleEx(const char * buf, in
 #endif
 }
 
-void writeConsole(const char * buf, int buflen) {
+static void writeConsole(const char * buf, int buflen) {
writeConsoleEx(buf, buflen, -42);
 }
 
-void clearRErrConsole(void) {
+static void clearRErrConsole(void) {
// Do nothing?
 }
 
@@ -230,16 +234,7 @@ static char *RAPIinstalladdons(void) {
return NULL;
 }
 
-rapi_export str RAPIevalStd(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-   InstrPtr pci) {
-   return RAPIeval(cntxt, mb, stk, pci, 0);
-}
-rapi_export str RAPIevalAggr(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
-InstrPtr pci) {
-   return RAPIeval(cntxt, mb, stk, pci, 1);
-}
-
-str RAPIeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, bit 
grouped) {
+static str RAPIeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, 
bit grouped) {
  

MonetDB: Jun2020 - SQLancer: inputs not the same size

2020-06-17 Thread Pedro Ferreira
Changeset: def240205246 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=def240205246
Modified Files:
sql/test/SQLancer/Tests/sqlancer01.sql
Branch: Jun2020
Log Message:

SQLancer: inputs not the same size


diffs (29 lines):

diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -312,6 +312,25 @@ having count(all (0.7) is not null) orde
 select all sum(all cast(t0.c0 as int)) as agg0 from v1 join t0 on 
cast(cast(v1.c1 as int) as boolean) where  (v1.c1) not in (v1.c1, 0.36970723) 
is null;
 ROLLBACK;
 
+START TRANSACTION; -- Bug 6908
+CREATE TABLE t0(c0 BOOLEAN,c1 CHAR(140));
+COMMENT ON TABLE "sys"."t0" IS 'Kn䛺䛺r';
+COPY 9 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+false  "0.6481236457757975-2109927659"
+NULL   "-21099276590.48742518585365991"
+false  NULL
+false  NULL
+false  "heQhWJBhttps://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Use bool.

2020-06-17 Thread Sjoerd Mullender
Changeset: bee061c0963e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bee061c0963e
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk_bbp.c
gdk/gdk_bbp.h
tools/embedded/monetdb_embedded.c
tools/merovingian/daemon/controlrunner.c
tools/monetdbe/monetdbe.c
tools/mserver/mserver5.c
tools/mserver/shutdowntest.c
Branch: default
Log Message:

Use bool.


diffs (122 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
@@ -194,7 +194,7 @@ void BATtseqbase(BAT *b, oid o);
 void BATundo(BAT *b);
 BAT *BATunique(BAT *b, BAT *s);
 BBPrec *BBP[N_BBPINIT];
-gdk_return BBPaddfarm(const char *dirname, int rolemask);
+gdk_return BBPaddfarm(const char *dirname, int rolemask, bool logerror);
 void BBPclear(bat bid);
 BAT *BBPdescriptor(bat b);
 int BBPfix(bat b);
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1110,7 +1110,7 @@ GDKinmemory(void)
 
 /* all errors are fatal */
 gdk_return
-BBPaddfarm(const char *dirname, int rolemask, int logerror)
+BBPaddfarm(const char *dirname, int rolemask, bool logerror)
 {
struct stat st;
int i;
diff --git a/gdk/gdk_bbp.h b/gdk/gdk_bbp.h
--- a/gdk/gdk_bbp.h
+++ b/gdk/gdk_bbp.h
@@ -56,7 +56,7 @@
 gdk_export bat getBBPsize(void); /* current occupied size of BBP array */
 
 /* global calls */
-gdk_export gdk_return BBPaddfarm(const char *dirname, int rolemask, int 
logerror);
+gdk_export gdk_return BBPaddfarm(const char *dirname, int rolemask, bool 
logerror);
 
 /* update interface */
 gdk_export void BBPclear(bat bid);
diff --git a/tools/embedded/monetdb_embedded.c 
b/tools/embedded/monetdb_embedded.c
--- a/tools/embedded/monetdb_embedded.c
+++ b/tools/embedded/monetdb_embedded.c
@@ -459,14 +459,14 @@ monetdb_startup(char* dbdir)
goto cleanup;
}
if (!dbdir) { /* in-memory */
-   if (BBPaddfarm(NULL, (1 << PERSISTENT) | (1 << TRANSIENT), 0) 
!= GDK_SUCCEED) {
+   if (BBPaddfarm(NULL, (1 << PERSISTENT) | (1 << TRANSIENT), 
false) != GDK_SUCCEED) {
mo_free_options(set, setlen);
msg = createException(MAL, "embedded.monetdb_startup", 
"Cannot add in-memory farm");
goto cleanup;
}
} else {
-   if (BBPaddfarm(dbdir, 1 << PERSISTENT, 0) != GDK_SUCCEED ||
-   BBPaddfarm(/*dbextra ? dbextra : */dbdir, 1 << 
TRANSIENT, 0) != GDK_SUCCEED) {
+   if (BBPaddfarm(dbdir, 1 << PERSISTENT, false) != GDK_SUCCEED ||
+   BBPaddfarm(/*dbextra ? dbextra : */dbdir, 1 << 
TRANSIENT, false) != GDK_SUCCEED) {
mo_free_options(set, setlen);
msg = createException(MAL, "embedded.monetdb_startup", 
"Cannot add farm %s", dbdir);
goto cleanup;
diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -447,7 +447,7 @@ static void ctl_handle_client(
free(sadbfarm);
setlen = 
mo_add_option(&set, setlen, opt_cmdline, "gdk_dbpath", buf2);
setlen = 
mo_system_config(&set, setlen);
-   if (BBPaddfarm(buf2, (1 
<< PERSISTENT) | (1 << TRANSIENT), 1) != GDK_SUCCEED) {
+   if (BBPaddfarm(buf2, (1 
<< PERSISTENT) | (1 << TRANSIENT), true) != GDK_SUCCEED) {

Mfprintf(_mero_ctlerr, "%s: could not add farm to "
"'%s': 
%d: %s\n", origin, q, errno, strerror(errno));
exit(0);
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -460,14 +460,14 @@ monetdbe_startup(char* dbdir, monetdbe_o
}
 
if (!dbdir) { /* in-memory */
-   if (BBPaddfarm(NULL, (1 << PERSISTENT) | (1 << TRANSIENT), 0) 
!= GDK_SUCCEED) {
+   if (BBPaddfarm(NULL, (1 << PERSISTENT) | (1 << TRANSIENT), 
false) != GDK_SUCCEED) {
mo_free_options(set, setlen);
msg = createException(MAL, "monetdbe.monetdbe_startup", 
"Cannot add in-memory farm");
goto cleanup;
}
} else {
-   if (BBPaddfarm(dbdir, 1 << PERSISTENT, 0) != GDK_SUCCEED ||
-   BBPaddfarm(/*dbextra ? dbextra : */dbdir, 1 << 
TRANSIENT, 0

MonetDB: Jun2020 - SQLancer, algebra.select undefined

2020-06-17 Thread Pedro Ferreira
Changeset: 830f1b925d45 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=830f1b925d45
Modified Files:
sql/test/SQLancer/Tests/sqlancer01.sql
Branch: Jun2020
Log Message:

SQLancer, algebra.select undefined


diffs (20 lines):

diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -302,6 +302,16 @@ select 1 from v0 full outer join t0 on c
 select cast(sum(all + (cast(t0.c0 as int))) as bigint) from v0 full outer join 
t0 on ((cast((cast(v0.c1 as boolean)) not in (true, ((t0.c0)=(t0.c0)), 
cast(1745166981 as boolean)) as string))ilike(v0.c0));
 ROLLBACK;
 
+START TRANSACTION; -- Bug 6907
+CREATE TABLE t0 (c0 BOOLEAN, c1 CHAR(140));
+create view v0(c0) as (select distinct 0.4 from t0 where 
((t0.c0)andlower(t0.c1))||(-69891801)/(1210439951)))+(cast(0.5895729273161221
 as int)) 
+between symmetric (cast(0.5 as string)) and (greatest(t0.c1, 
((t0.c1)||(-2045486895)));
+create view v1(c0, c1) as (select all 0.1, cast(0.2 as int))/(+ 
(-212060493)*(816153822)))|(((222046)+(1143103273%(cast(cast(0.76693934
 as int) as int))) from v0 
+group by 0.3, cast(- (cast(2.22046E9 as int)) as boolean), 
sql_max(cast(cast(v0.c0 as string(336)) as int), length('1')), 
((cast(0.19825737 as int))%(-1509376269)), v0.c0
+having count(all (0.7) is not null) order by v0.c0 asc nulls first) with check 
option;
+select all sum(all cast(t0.c0 as int)) as agg0 from v1 join t0 on 
cast(cast(v1.c1 as int) as boolean) where  (v1.c1) not in (v1.c1, 0.36970723) 
is null;
+ROLLBACK;
+
 DROP TABLE tbl_ProductSales;
 DROP TABLE another_T;
 DROP TABLE integers;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Reduce casting of function pointers, reduce e...

2020-06-17 Thread Sjoerd Mullender
Changeset: bae3132affe6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bae3132affe6
Modified Files:
clients/Tests/exports.stable.out
geom/monetdb5/geom.c
geom/monetdb5/geom.h
monetdb5/mal/mal_prelude.c
monetdb5/mal/mel.h
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/blob.h
monetdb5/modules/atoms/color.c
monetdb5/modules/atoms/color.h
monetdb5/modules/atoms/identifier.c
monetdb5/modules/atoms/inet.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/json.h
monetdb5/modules/atoms/url.c
monetdb5/modules/atoms/url.h
monetdb5/modules/atoms/uuid.c
monetdb5/modules/atoms/xml.c
monetdb5/modules/atoms/xml.h
Branch: default
Log Message:

Reduce casting of function pointers, reduce exports.


diffs (truncated from 1454 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
@@ -948,22 +948,12 @@ str BKCsetTransient(void *r, const bat *
 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);
-int BLOBcmp(const blob *l, const blob *r);
-void BLOBdel(Heap *h, var_t *index);
-ssize_t BLOBfromstr(const char *instr, size_t *l, blob **val, bool external);
 int BLOBget(Heap *h, int *bun, int *l, blob **val);
-BUN BLOBhash(const blob *b);
-void BLOBheap(Heap *heap, size_t capacity);
-size_t BLOBlength(const blob *p);
 str BLOBnitems(int *ret, blob **b);
 str BLOBnitems_bulk(bat *ret, const bat *bid);
-const blob *BLOBnull(void);
 str BLOBprelude(void *ret);
-var_t BLOBput(Heap *h, var_t *bun, const blob *val);
-blob *BLOBread(blob *a, stream *s, size_t cnt);
 str BLOBtoblob(blob **retval, str *s);
-ssize_t BLOBtostr(str *tostr, size_t *l, const blob *pin, bool external);
-gdk_return BLOBwrite(const blob *a, stream *s, size_t cnt);
+ssize_t BLOBtostr(str *tostr, size_t *l, const void *pin, bool external);
 str CALCmax(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str CALCmax_no_nil(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str CALCmin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
@@ -1312,9 +1302,7 @@ str GRPsubgroup7(bat *ngid, bat *next, c
 str GRPsubgroup8(bat *ngid, bat *next, const bat *bid, const bat *gid, const 
bat *eid, const bat *hid);
 str GRPsubgroup9(bat *ngid, bat *next, const bat *bid, const bat *sid, const 
bat *gid, const bat *eid, const bat *hid);
 str IDentifier(identifier *retval, str *in);
-ssize_t IDfromString(const char *src, size_t *len, identifier *retval, bool 
external);
 str IDprelude(void *ret);
-ssize_t IDtoString(str *retval, size_t *len, const char *handle, bool 
external);
 str ILIKEjoin(bat *r1, bat *r2, const bat *lid, const bat *rid, const bat 
*slid, const bat *srid, const bit *nil_matches, const lng *estimate, const bit 
*anti);
 str ILIKEjoin1(bat *r1, const bat *lid, const bat *rid, const bat *slid, const 
bat *srid, const bit *nil_matches, const lng *estimate, const bit *anti);
 str ILIKEjoin_esc(bat *r1, bat *r2, const bat *lid, const bat *rid, const str 
*esc, const bat *slid, const bat *srid, const bit *nil_matches, const lng 
*estimate, const bit *anti);
@@ -1334,18 +1322,14 @@ str INET_inet(inet *d, const inet *s);
 str INET_isnil(bit *retval, const inet *val);
 str INETabbrev(str *retval, const inet *val);
 str INETbroadcast(inet *retval, const inet *val);
-int INETcompare(const inet *l, const inet *r);
-ssize_t INETfromString(const char *src, size_t *len, inet **retval, bool 
external);
 str INEThost(str *retval, const inet *val);
 str INEThostmask(inet *retval, const inet *val);
 str INETmasklen(int *retval, const inet *val);
 str INETnetmask(inet *retval, const inet *val);
 str INETnetwork(inet *retval, const inet *val);
 str INETnew(inet *retval, str *in);
-const inet *INETnull(void);
 str INETsetmasklen(inet *retval, const inet *val, const int *msk);
 str INETtext(str *retval, const inet *val);
-ssize_t INETtoString(str *retval, size_t *len, const inet *handle, bool 
external);
 str INSPECTatom_names(bat *ret);
 str INSPECTatom_sizes(bat *ret);
 str INSPECTatom_sup_names(bat *ret);
@@ -1397,7 +1381,6 @@ str JSONfilterArray_int(json *ret, json 
 str JSONfilterArray_lng(json *ret, json *j, lng *index);
 str JSONfilterArray_sht(json *ret, json *j, sht *index);
 str JSONfold(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-ssize_t JSONfromString(const char *src, size_t *len, json *x, bool external);
 str JSONgroupStr(str *ret, const bat *bid);
 str JSONisarray(bit *ret, json *j);
 str JSONisobject(bit *ret, json *j);
@@ -1417,7 +1400,6 @@ str JSONresultSet(json *res, bat *u, bat
 str JSONstr2json(json *ret, str *j);
 str JSONsubjson(bat *retval, bat *bid, bat *gid, bat *eid, bit *skipnils);
 str JSONsubjsoncand(bat *retval, bat *bid, bat *gid, bat *eid

MonetDB: default - merged

2020-06-17 Thread Niels Nes
Changeset: 8e24dc8e3911 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8e24dc8e3911
Modified Files:
gdk/gdk_hash.c
monetdb5/modules/atoms/uuid.c
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_select.c

sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out
sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
sql/test/BugTracker-2018/Tests/convert-key.Bug-6648.stable.out
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
sql/test/BugTracker/Tests/convert_dec2varchar.SF-1774312.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/SQLancer/Tests/sqlancer01.sql
sql/test/SQLancer/Tests/sqlancer01.stable.err
sql/test/SQLancer/Tests/sqlancer01.stable.out
sql/test/bugs/Tests/cast_varchar2int-bug-sf-964165.stable.out
sql/test/mergetables/Tests/mergeinit.stable.err
sql/test/miscellaneous/Tests/groupings.stable.out
sql/test/miscellaneous/Tests/simple_plans.sql
sql/test/miscellaneous/Tests/simple_plans.stable.out
sql/test/miscellaneous/Tests/simple_selects.stable.out
sql/test/pg_regress/Tests/date.stable.out
sql/test/pg_regress/Tests/int8.stable.out
sql/test/pg_regress/Tests/int8.stable.out.int128
Branch: default
Log Message:

merged


diffs (truncated from 13199 to 300 lines):

diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -97,7 +97,11 @@ HASHclear(Hash *h)
memset(h->Bckt, 0xFF, h->nbucket * h->width);
 }
 
-#define HASH_VERSION   3
+#define HASH_VERSION   4
+/* this is only for the change of hash function of the UUID type; if
+ * HASH_VERSION is increased again from 4, the code associated with
+ * HASH_VERSION_NOUUID must be deleted */
+#define HASH_VERSION_NOUUID3
 #define HASH_HEADER_SIZE   7   /* nr of size_t fields in header */
 
 static void
@@ -442,11 +446,21 @@ BATcheckhash(BAT *b)
struct stat st;
 
if (read(fd, hdata, sizeof(hdata)) == 
sizeof(hdata) &&
-   hdata[0] == (
+   (hdata[0] == (
 #ifdef PERSISTENTHASH
((size_t) 1 << 24) |
 #endif
-   HASH_VERSION) &&
+   HASH_VERSION)
+#ifdef HASH_VERSION_NOUUID
+/* if not uuid, also allow 
previous version */
+|| (hdata[0] == (
+#ifdef PERSISTENTHASH
+((size_t) 1 << 24) |
+#endif
+HASH_VERSION_NOUUID) &&
+strcmp(ATOMname(b->ttype), 
"uuid") != 0)
+#endif
+   ) &&
hdata[1] > 0 &&
hdata[4] == (size_t) BATcount(b) &&
fstat(fd, &st) == 0 &&
diff --git a/monetdb5/modules/atoms/uuid.c b/monetdb5/modules/atoms/uuid.c
--- a/monetdb5/modules/atoms/uuid.c
+++ b/monetdb5/modules/atoms/uuid.c
@@ -330,17 +330,19 @@ BUN
 UUIDhash(const void *v)
 {
const uuid *u = (const uuid *) v;
-   unsigned int u1, u2, u3, u4;
+   ulng u1, u2;
 
-   u1 = (unsigned int) u->u[0] << 24 | (unsigned int) u->u[1] << 16 |
-   (unsigned int) u->u[2] << 8 | (unsigned int) u->u[3];
-   u2 = (unsigned int) u->u[4] << 24 | (unsigned int) u->u[5] << 16 |
-   (unsigned int) u->u[6] << 8 | (unsigned int) u->u[7];
-   u3 = (unsigned int) u->u[8] << 24 | (unsigned int) u->u[9] << 16 |
-   (unsigned int) u->u[10] << 8 | (unsigned int) u->u[11];
-   u4 = (unsigned int) u->u[12] << 24 | (unsigned int) u->u[13] << 16 |
-   (unsigned int) u->u[14] << 8 | (unsigned int) u->u[15];
-   return (BUN) mix_int(u1 ^ u2 ^ u3 ^ u4);
+   u1 = (ulng) u->u[0] << 56 | (ulng) u->u[1] << 48 |
+   (ulng) u->u[2] << 40 | (ulng) u->u[3] << 32 |
+   (ulng) u->u[4] << 24 | (ulng) u->u[5] << 16 |
+   (ulng) u->u[6] << 8 | (ulng) u->u[7];
+   u2 = (ulng) u->u[8] << 56 | (ulng) u->u[9] << 48 |
+   (ulng) u->u[

MonetDB: default - initialize dbhdl also on queries without results

2020-06-17 Thread Niels Nes
Changeset: 84b03581f18f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84b03581f18f
Modified Files:
tools/monetdbe/monetdbe.c
Branch: default
Log Message:

initialize dbhdl also on queries without results


diffs (35 lines):

diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -307,6 +307,7 @@ monetdbe_query_internal(monetdbe_databas
else
res_internal->type = (m->results) ? 
m->results->query_type : m->type;
res_internal->res.last_id = m->last_id;
+   res_internal->dbhdl = dbhdl;
*result = (monetdbe_result*) res_internal;
m->reply_size = -2; /* do not clean up result tables */
 
@@ -323,7 +324,6 @@ monetdbe_query_internal(monetdbe_databas
}
res_internal->monetdbe_resultset = m->results;
res_internal->converted_columns = 
GDKzalloc(sizeof(monetdbe_column*) * res_internal->res.ncols);
-   res_internal->dbhdl = dbhdl;
if (!res_internal->converted_columns) {
msg = createException(MAL, 
"monetdbe.monetdbe_query_internal", MAL_MALLOC_FAIL);
goto cleanup;
@@ -776,6 +776,7 @@ monetdbe_execute(monetdbe_statement *stm
}
res_internal->type = (m->results) ? Q_TABLE : Q_UPDATE;
res_internal->res.last_id = m->last_id;
+   res_internal->dbhdl = dbhdl;
*result = (monetdbe_result*) res_internal;
m->reply_size = -2; /* do not clean up result tables */
 
@@ -792,7 +793,6 @@ monetdbe_execute(monetdbe_statement *stm
}
res_internal->monetdbe_resultset = m->results;
res_internal->converted_columns = 
GDKzalloc(sizeof(monetdbe_column*) * res_internal->res.ncols);
-   res_internal->dbhdl = dbhdl;
if (!res_internal->converted_columns) {
msg = createException(MAL, 
"monetdbe.monetdbe_query_internal", MAL_MALLOC_FAIL);
goto cleanup;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged with Jun2020

2020-06-17 Thread Pedro Ferreira
Changeset: 9dbc91b83efa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9dbc91b83efa
Modified Files:
gdk/gdk_hash.c
monetdb5/modules/atoms/uuid.c
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_select.c

sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out
sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
sql/test/BugTracker-2018/Tests/convert-key.Bug-6648.stable.out
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
sql/test/BugTracker/Tests/convert_dec2varchar.SF-1774312.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/SQLancer/Tests/sqlancer01.sql
sql/test/SQLancer/Tests/sqlancer01.stable.err
sql/test/SQLancer/Tests/sqlancer01.stable.out
sql/test/bugs/Tests/cast_varchar2int-bug-sf-964165.stable.out
sql/test/mergetables/Tests/mergeinit.stable.err
sql/test/miscellaneous/Tests/groupings.stable.out
sql/test/miscellaneous/Tests/simple_plans.sql
sql/test/miscellaneous/Tests/simple_plans.stable.out
sql/test/miscellaneous/Tests/simple_selects.stable.out
sql/test/pg_regress/Tests/date.stable.out
sql/test/pg_regress/Tests/int8.stable.out
sql/test/pg_regress/Tests/int8.stable.out.int128
Branch: default
Log Message:

Merged with Jun2020


diffs (truncated from 13199 to 300 lines):

diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -97,7 +97,11 @@ HASHclear(Hash *h)
memset(h->Bckt, 0xFF, h->nbucket * h->width);
 }
 
-#define HASH_VERSION   3
+#define HASH_VERSION   4
+/* this is only for the change of hash function of the UUID type; if
+ * HASH_VERSION is increased again from 4, the code associated with
+ * HASH_VERSION_NOUUID must be deleted */
+#define HASH_VERSION_NOUUID3
 #define HASH_HEADER_SIZE   7   /* nr of size_t fields in header */
 
 static void
@@ -442,11 +446,21 @@ BATcheckhash(BAT *b)
struct stat st;
 
if (read(fd, hdata, sizeof(hdata)) == 
sizeof(hdata) &&
-   hdata[0] == (
+   (hdata[0] == (
 #ifdef PERSISTENTHASH
((size_t) 1 << 24) |
 #endif
-   HASH_VERSION) &&
+   HASH_VERSION)
+#ifdef HASH_VERSION_NOUUID
+/* if not uuid, also allow 
previous version */
+|| (hdata[0] == (
+#ifdef PERSISTENTHASH
+((size_t) 1 << 24) |
+#endif
+HASH_VERSION_NOUUID) &&
+strcmp(ATOMname(b->ttype), 
"uuid") != 0)
+#endif
+   ) &&
hdata[1] > 0 &&
hdata[4] == (size_t) BATcount(b) &&
fstat(fd, &st) == 0 &&
diff --git a/monetdb5/modules/atoms/uuid.c b/monetdb5/modules/atoms/uuid.c
--- a/monetdb5/modules/atoms/uuid.c
+++ b/monetdb5/modules/atoms/uuid.c
@@ -330,17 +330,19 @@ BUN
 UUIDhash(const void *v)
 {
const uuid *u = (const uuid *) v;
-   unsigned int u1, u2, u3, u4;
+   ulng u1, u2;
 
-   u1 = (unsigned int) u->u[0] << 24 | (unsigned int) u->u[1] << 16 |
-   (unsigned int) u->u[2] << 8 | (unsigned int) u->u[3];
-   u2 = (unsigned int) u->u[4] << 24 | (unsigned int) u->u[5] << 16 |
-   (unsigned int) u->u[6] << 8 | (unsigned int) u->u[7];
-   u3 = (unsigned int) u->u[8] << 24 | (unsigned int) u->u[9] << 16 |
-   (unsigned int) u->u[10] << 8 | (unsigned int) u->u[11];
-   u4 = (unsigned int) u->u[12] << 24 | (unsigned int) u->u[13] << 16 |
-   (unsigned int) u->u[14] << 8 | (unsigned int) u->u[15];
-   return (BUN) mix_int(u1 ^ u2 ^ u3 ^ u4);
+   u1 = (ulng) u->u[0] << 56 | (ulng) u->u[1] << 48 |
+   (ulng) u->u[2] << 40 | (ulng) u->u[3] << 32 |
+   (ulng) u->u[4] << 24 | (ulng) u->u[5] << 16 |
+   (ulng) u->u[6] << 8 | (ulng) u->u[7];
+   u2 = (ulng) u->u[8] << 56 | (ulng) u->u[9] << 48 |
+  

MonetDB: Jun2020 - I forgot the theta join case

2020-06-17 Thread Pedro Ferreira
Changeset: 95db938bd036 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=95db938bd036
Modified Files:
sql/test/miscellaneous/Tests/simple_plans.sql
sql/test/miscellaneous/Tests/simple_plans.stable.out
Branch: Jun2020
Log Message:

I forgot the theta join case


diffs (104 lines):

diff --git a/sql/test/miscellaneous/Tests/simple_plans.sql 
b/sql/test/miscellaneous/Tests/simple_plans.sql
--- a/sql/test/miscellaneous/Tests/simple_plans.sql
+++ b/sql/test/miscellaneous/Tests/simple_plans.sql
@@ -26,4 +26,5 @@ EXPLAIN SELECT 1 FROM another_t t1 INNER
 EXPLAIN SELECT 1 FROM another_t t1 INNER JOIN another_t t2 ON t1.col1 BETWEEN 
t2.col1 AND 2;
 EXPLAIN SELECT 1 FROM tbl_productsales t1 INNER JOIN tbl_productsales t2 ON 
t1.product_category LIKE t2.product_category;
 
+EXPLAIN SELECT 1 FROM another_t t1 INNER JOIN another_t t2 ON t1.col1 > 
t2.col1;
 rollback;
diff --git a/sql/test/miscellaneous/Tests/simple_plans.stable.out 
b/sql/test/miscellaneous/Tests/simple_plans.stable.out
--- a/sql/test/miscellaneous/Tests/simple_plans.stable.out
+++ b/sql/test/miscellaneous/Tests/simple_plans.stable.out
@@ -395,8 +395,89 @@ end user.s26_0;
 #multiplexactions= 0 time=3 usec 
 #profiler actions= 1 time=2 usec 
 #candidates   actions= 1 time=2 usec 
-#deadcode actions= 0 time=12 usec 
-#postfix  actions= 0 time=9 usec 
+#deadcode actions= 0 time=9 usec 
+#postfix  actions= 0 time=6 usec 
+#wlc  actions= 0 time=1 usec 
+#garbagecollector actions= 1 time=45 usec 
+#totalactions=29 time=478 usec 
+#EXPLAIN SELECT 1 FROM another_t t1 INNER JOIN another_t t2 ON t1.col1 > 
t2.col1;
+% .explain # table_name
+% mal # name
+% clob # type
+% 148 # length
+function user.s28_0():void;
+X_2:void := querylog.define("explain select 1 from another_t t1 inner join 
another_t t2 on t1.col1 > t2.col1;":str, "default_pipe":str, 23:int);
+barrier X_133:bit := language.dataflow();
+X_30:bat[:str] := bat.pack(".%3":str);
+X_31:bat[:str] := bat.pack("%3":str);
+X_32:bat[:str] := bat.pack("tinyint":str);
+X_33:bat[:int] := bat.pack(1:int);
+X_34:bat[:int] := bat.pack(0:int);
+X_5:int := sql.mvc();
+C_79:bat[:oid] := sql.tid(X_5:int, "sys":str, "another_t":str, 0:int, 
4:int);
+X_90:bat[:int] := sql.bind(X_5:int, "sys":str, "another_t":str, 
"col1":str, 0:int, 0:int, 4:int);
+X_95:bat[:int] := algebra.projection(C_79:bat[:oid], X_90:bat[:int]);
+C_13:bat[:oid] := sql.tid(X_5:int, "sys":str, "another_t":str);
+X_15:bat[:int] := sql.bind(X_5:int, "sys":str, "another_t":str, 
"col1":str, 0:int);
+X_17:bat[:int] := algebra.projection(C_13:bat[:oid], X_15:bat[:int]);
+(X_99:bat[:oid], X_100:bat[:oid]) := algebra.thetajoin(X_95:bat[:int], 
X_17:bat[:int], nil:BAT, nil:BAT, 1:int, true:bit, nil:lng);
+X_107:bat[:int] := algebra.projection(X_99:bat[:oid], X_95:bat[:int]);
+X_115:bat[:bte] := algebra.project(X_107:bat[:int], 1:bte);
+C_81:bat[:oid] := sql.tid(X_5:int, "sys":str, "another_t":str, 1:int, 
4:int);
+X_91:bat[:int] := sql.bind(X_5:int, "sys":str, "another_t":str, 
"col1":str, 0:int, 1:int, 4:int);
+X_96:bat[:int] := algebra.projection(C_81:bat[:oid], X_91:bat[:int]);
+(X_101:bat[:oid], X_102:bat[:oid]) := algebra.thetajoin(X_96:bat[:int], 
X_17:bat[:int], nil:BAT, nil:BAT, 1:int, true:bit, nil:lng);
+X_108:bat[:int] := algebra.projection(X_101:bat[:oid], X_96:bat[:int]);
+X_116:bat[:bte] := algebra.project(X_108:bat[:int], 1:bte);
+C_83:bat[:oid] := sql.tid(X_5:int, "sys":str, "another_t":str, 2:int, 
4:int);
+X_92:bat[:int] := sql.bind(X_5:int, "sys":str, "another_t":str, 
"col1":str, 0:int, 2:int, 4:int);
+X_97:bat[:int] := algebra.projection(C_83:bat[:oid], X_92:bat[:int]);
+(X_103:bat[:oid], X_104:bat[:oid]) := algebra.thetajoin(X_97:bat[:int], 
X_17:bat[:int], nil:BAT, nil:BAT, 1:int, true:bit, nil:lng);
+X_109:bat[:int] := algebra.projection(X_103:bat[:oid], X_97:bat[:int]);
+X_117:bat[:bte] := algebra.project(X_109:bat[:int], 1:bte);
+C_85:bat[:oid] := sql.tid(X_5:int, "sys":str, "another_t":str, 3:int, 
4:int);
+X_93:bat[:int] := sql.bind(X_5:int, "sys":str, "another_t":str, 
"col1":str, 0:int, 3:int, 4:int);
+X_98:bat[:int] := algebra.projection(C_85:bat[:oid], X_93:bat[:int]);
+(X_105:bat[:oid], X_106:bat[:oid]) := algebra.thetajoin(X_98:bat[:int], 
X_17:bat[:int], nil:BAT, nil:BAT, 1:int, true:bit, nil:lng);
+X_110:bat[:int] := algebra.projection(X_105:bat[:oid], X_98:bat[:int]);
+X_118:bat[:bte] := algebra.project(X_110:bat[:int], 1:bte);
+X_127:bat[:bte] := mat.packIncrement(X_115:bat[:bte], 4:int);
+X_129:bat[:bte] := mat.packIncrement(X_127:bat[:bte], X_116:bat[:bte]);
+X_130:bat[:bte] := mat.packIncrement(X_129:bat[:bte], X_117:bat[:bte]);
+X_28:bat[:bte] := mat.packIncrement(X_130:bat[:bte], X_118:bat[:bte]);
+language.pass

MonetDB: Jun2020 - Fix for SQLancer crash, ie make the split bet...

2020-06-17 Thread Pedro Ferreira
Changeset: 638bb98f4199 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=638bb98f4199
Modified Files:
sql/backends/monet5/rel_bin.c
sql/test/SQLancer/Tests/sqlancer01.sql
sql/test/SQLancer/Tests/sqlancer01.stable.out
sql/test/miscellaneous/Tests/simple_plans.sql
sql/test/miscellaneous/Tests/simple_plans.stable.out
Branch: Jun2020
Log Message:

Fix for SQLancer crash, ie make the split between join and select expressions 
more evident. I added some explain tests to test crossproducts are not 
generated on "regular" queries


diffs (truncated from 481 to 300 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -2210,59 +2210,55 @@ rel2bin_join(backend *be, sql_rel *rel, 
if (!list_empty(rel->exps)) {
for( en = rel->exps->h, i=0; en; en = en->next, i++) {
sql_exp *e = en->data;
+   int left_reference = 0, right_reference = 0;
 
/* we can handle thetajoins, rangejoins and 
filter joins (like) */
/* ToDo how about in/notin, mark_in/notin, 
mark_exists/not_exists and atom expressions? */
if (e->type == e_cmp) {
int flag = e->flag & ~CMP_BETWEEN;
/* check if its a select or join 
expression, ie use only expressions of one relation left and of the other right 
(than join) */
-   if (flag < cmp_filter && !e->f) { /* 
theta join */
+   if (flag < cmp_filter) { /* theta and 
range joins */
/* join or select ? */
-   if ((rel_find_exp(rel->l, e->l) 
&& !rel_find_exp(rel->r, e->l) &&
-rel_find_exp(rel->r, e->r) 
&& !rel_find_exp(rel->l, e->r)) ||
-   (rel_find_exp(rel->r, e->l) 
&& !rel_find_exp(rel->l, e->l) &&
-rel_find_exp(rel->l, e->r) 
&& !rel_find_exp(rel->r, e->r))) {
-   append(jexps, e);
-   continue;
+   sql_exp *l = e->l, *r = e->r, 
*f = e->f;
+
+   if (l->card != CARD_ATOM) {
+   left_reference += 
rel_find_exp(rel->l, l) != NULL;
+   right_reference += 
rel_find_exp(rel->r, l) != NULL;
}
-   } else if (flag < cmp_filter && e->f) { 
/* range */
-   int nrcr1 = 0, nrcr2 = 0, nrcl1 
= 0, nrcl2 = 0;
-   if ((rel_find_exp(rel->l, e->l) 
&& !rel_find_exp(rel->r, e->l) &&
-  ((rel_find_exp(rel->r, e->r) 
&& !rel_find_exp(rel->l, e->r)) || (nrcr1 = ((sql_exp*)e->r)->card == 
CARD_ATOM)) &&
-  ((rel_find_exp(rel->r, e->f) 
&& !rel_find_exp(rel->l, e->f)) || (nrcr2 = ((sql_exp*)e->f)->card == 
CARD_ATOM)) && (nrcr1+nrcr2) <= 1) ||
-   (rel_find_exp(rel->r, e->l) 
&& !rel_find_exp(rel->l, e->l) &&
-  ((rel_find_exp(rel->l, e->r) 
&& !rel_find_exp(rel->r, e->r)) || (nrcl1 = ((sql_exp*)e->r)->card == 
CARD_ATOM)) &&
-  ((rel_find_exp(rel->l, e->f) 
&& !rel_find_exp(rel->r, e->f)) || (nrcl2 = ((sql_exp*)e->f)->card == 
CARD_ATOM)) && (nrcl1+nrcl2) <= 1)) {
-   append(jexps, e);
-   continue;
+   if (r->card != CARD_ATOM) {
+   left_reference += 
rel_find_exp(rel->l, r) != NULL;
+   right_reference += 
rel_find_exp(rel->r, r) != NULL;
+   }
+   if (f && f->card != CARD_ATOM) {
+   left_reference += 
rel_find_exp(rel->l, f) != NULL;
+   right_reference += 
rel_find_exp(rel->r, f) != NULL;
}
} else if (flag == cmp_filter && 
!e->anti) {
-   

MonetDB: unlock - New function HEAPgrow to grow a heap using ref...

2020-06-17 Thread Sjoerd Mullender
Changeset: 19dc30bfd08d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19dc30bfd08d
Modified Files:
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_heap.c
gdk/gdk_private.h
Branch: unlock
Log Message:

New function HEAPgrow to grow a heap using reference counting.


diffs (95 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -467,10 +467,15 @@ BATextend(BAT *b, BUN newcap)
 
theap_size *= Tsize(b);
if (b->theap->base) {
-   TRC_DEBUG(HEAP, "HEAPextend in BATextend %s %zu %zu\n",
+   TRC_DEBUG(HEAP, "HEAPgrow in BATextend %s %zu %zu\n",
  b->theap->filename, b->theap->size, theap_size);
-   if (HEAPextend(b->theap, theap_size, b->batRestricted == 
BAT_READ) != GDK_SUCCEED)
+   Heap *h = HEAPgrow(b->theap, theap_size);
+   if (h == NULL)
return GDK_FAIL;
+   MT_lock_set(&b->theaplock);
+   HEAPdecref(b->theap, false);
+   b->theap = h;
+   MT_lock_unset(&b->theaplock);
}
return GDK_SUCCEED;
 }
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -176,10 +176,13 @@ insert_string_bat(BAT *b, BAT *n, struct
toff = (toff + GDK_VARALIGN - 1) & 
~(GDK_VARALIGN - 1);
/* if in "force" mode, the heap may be
 * shared when memory mapped */
-   if (HEAPextend(b->tvheap, toff + 
n->tvheap->size, force) != GDK_SUCCEED) {
-   toff = ~(size_t) 0;
+   Heap *h = HEAPgrow(b->tvheap, toff + 
n->tvheap->size);
+   if (h == NULL)
return GDK_FAIL;
-   }
+   MT_lock_set(&b->theaplock);
+   HEAPdecref(b->tvheap, false);
+   b->tvheap = h;
+   MT_lock_unset(&b->theaplock);
memcpy(b->tvheap->base + toff, n->tvheap->base, 
n->tvheap->free);
b->tvheap->free = toff + n->tvheap->free;
if (toff > 0) {
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -85,6 +85,38 @@ decompose_filename(str nme)
return ext;
 }
 
+Heap *
+HEAPgrow(const Heap *old, size_t size)
+{
+   assert(size >= old->free);
+   assert(old->storage == STORE_MEM || old->storage == STORE_MMAP);
+
+   Heap *new = GDKmalloc(sizeof(Heap));
+   if (new == NULL)
+   return NULL;
+   *new = (Heap) {
+   .farmid = old->farmid,
+   .hashash = old->hashash,
+   .cleanhash = old->cleanhash,
+   .dirty = true,
+   .remove = old->remove,
+   .parentid = old->parentid,
+   };
+   memcpy(new->filename, old->filename, sizeof(new->filename));
+   if (HEAPalloc(new, size, 1) != GDK_SUCCEED) {
+   GDKfree(new);
+   return NULL;
+   }
+   ATOMIC_INIT(&new->refs, 1);
+   assert(new->storage == STORE_MEM || new->storage == STORE_MMAP);
+   new->free = old->free;
+   if (old->free > 0 &&
+   (new->storage == STORE_MEM || old->storage == STORE_MEM))
+   memcpy(new->base, old->base, old->free);
+   /* else both are STORE_MMAP and refer to the same file */
+   return new;
+}
+
 /*
  * @- HEAPalloc
  *
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -186,6 +186,8 @@ gdk_return HEAPdelete(Heap *h, const cha
__attribute__((__visibility__("hidden")));
 void HEAPfree(Heap *h, bool remove)
__attribute__((__visibility__("hidden")));
+Heap *HEAPgrow(const Heap *old, size_t size)
+   __attribute__((__visibility__("hidden")));
 gdk_return HEAPload(Heap *h, const char *nme, const char *ext, bool trunc)
__attribute__((__warn_unused_result__))
__attribute__((__visibility__("hidden")));
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Get rid of some old autotools stuff.

2020-06-17 Thread Sjoerd Mullender
Changeset: 53aec6c4413d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=53aec6c4413d
Removed Files:
buildtools/autogen/autogen.py
buildtools/autogen/autogen/__init__.py
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/codegen.py
buildtools/autogen/autogen/filesplit.py
buildtools/autogen/autogen/msc.py
buildtools/autogen/autogen/var.py
buildtools/conf/config.rpath
buildtools/conf/rules.mk
Branch: default
Log Message:

Get rid of some old autotools stuff.


diffs (truncated from 3537 to 300 lines):

diff --git a/buildtools/autogen/autogen.py b/buildtools/autogen/autogen.py
deleted file mode 100755
--- a/buildtools/autogen/autogen.py
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/env python3
-
-# 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 - 2020 MonetDB B.V.
-
-#
-# autogen scans the makefile.ag
-# and generates both the makefile.am and makefile.msc
-#
-
-import sys
-del sys.path[0]
-import fileinput
-import string
-import re
-from autogen import am
-from autogen import msc
-from autogen.codegen import *
-import tokenize
-from autogen import var
-import os
-
-def isName(t):
-return t not in ("{", "}", "=")
-
-class parser:
-def __init__ (self):
-self.curvar = var.groupvar("top")
-self.top = self.curvar
-self.cnt = 0
-self.state = "defs"
-self.stack = []
-self.curvar.add("TARGETS", {})
-
-#def parse(self, type, token, (srow, scol), (erow, ecol), line):
-def parse(self, token, srow, line):
-# order is important
-if self.state == "defs" and token == "\n":
-return
-if self.state == "\\" and token == "\n":
-self.state = "="
-elif self.state == "defs" and isName(token):
-if self.curvar != None:
-self.stack.append(self.curvar)
-self.curvar = var.var(token)
-self.state = "var"
-elif self.state == "=" and token == "\\":
-self.state = "\\"
-elif self.state == "var" and token == "=":
-self.state = "="
-elif self.state == "=" and token == "{":
-self.curvar = var.groupvar(self.curvar._name)
-self.state = "defs"
-self.cnt = self.cnt+1
-elif (self.state == "defs" and token == "}") or (self.state == "=" and 
token == "\n") or (self.state == "var" and token == "\n"):
-last = len(self.stack)-1
-v = self.stack[last]
-del self.stack[last]
-v.add(self.curvar._name, self.curvar._values)
-self.curvar = v
-self.cnt = self.cnt - 1
-self.state = "defs"
-elif self.state == "=" and isName(token):
-if token == '""':
-token = ""
-if token in self.top:
-for i in self.top[token]:
-self.curvar.append(i)
-else:
-self.curvar.append(token)
-elif self.state == "var" and token != "=":
-print("Missing = " + token, srow)
-else:
-print("error", token, self.state)
-
-
-def read_makefile(p, cwd):
-lineno = 0
-for line in fileinput.input(os.path.join(cwd, 'Makefile.ag')):
-if line.lstrip()[0:1] != "#":
-for token in line.split():
-p.parse(token, lineno, line)
-p.parse("\n", lineno, line)
-lineno = lineno + 1
-
-automake="1004000"
-if len(sys.argv) > 1:
-topdir = sys.argv[1]
-if len(sys.argv) > 2:
-automake = sys.argv[2]
-else:
-topdir = os.getcwd()
-
-def expand_subdirs(subdirs):
-res = []
-for subdir in subdirs:
-if "?" in subdir:
-parts = subdir.split("?")
-if len(parts) == 2:
-dirs = parts[1].split(":")
-if len(dirs) > 2:
-print("!ERROR:syntax error in conditional subdir: " + 
subdir)
-else:
-cond = parts[0]
-for d in dirs:
-if d.strip() != "":
-res.append((d, cond))
-cond = "!" + cond
-else:
-print("!ERROR:syntax error in conditional subdir: " + subdir)
-else:
-res.append((subdir, None))
-return res
-
-# incdirsmap is a map between srcdir and install-include-dir
-def main(cwd, topdir, automake, incdirsmap, conditional = ()):
-p = parser()
-read_makefile(p, cwd)
-codegen(p.curvar, cwd, topdir, incdirsmap)
-(InstallList, DocList, OutList) = am.output(p.curvar, cwd, topdir, 
automake, conditional)
-msc.output(p.curvar, cwd, topdir)
-if 'SUBDIRS' in p.curvar:
-for (dir, con

MonetDB: default - do not try to output errors during initialisa...

2020-06-17 Thread Niels Nes
Changeset: b18bf65990ad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b18bf65990ad
Modified Files:
gdk/gdk_bbp.c
gdk/gdk_bbp.h
tools/embedded/monetdb_embedded.c
tools/merovingian/daemon/controlrunner.c
tools/monetdbe/monetdbe.c
tools/mserver/mserver5.c
tools/mserver/shutdowntest.c
Branch: default
Log Message:

do not try to output errors during initialisation (even before GDKinit) in 
embedded mode


diffs (170 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1110,7 +1110,7 @@ GDKinmemory(void)
 
 /* all errors are fatal */
 gdk_return
-BBPaddfarm(const char *dirname, int rolemask)
+BBPaddfarm(const char *dirname, int rolemask, int logerror)
 {
struct stat st;
int i;
@@ -1123,21 +1123,25 @@ BBPaddfarm(const char *dirname, int role
return GDK_SUCCEED;
}
if (strchr(dirname, '\n') != NULL) {
-   GDKerror("no newline allowed in directory name\n");
+   if (logerror)
+   GDKerror("no newline allowed in directory name\n");
return GDK_FAIL;
}
if (rolemask == 0 || (rolemask & 1 && BBPfarms[0].dirname != NULL)) {
-   GDKerror("bad rolemask\n");
+   if (logerror)
+   GDKerror("bad rolemask\n");
return GDK_FAIL;
}
if (mkdir(dirname, MONETDB_DIRMODE) < 0) {
if (errno == EEXIST) {
if (stat(dirname, &st) == -1 || !S_ISDIR(st.st_mode)) {
-   GDKerror("%s: not a directory\n", dirname);
+   if (logerror)
+   GDKerror("%s: not a directory\n", 
dirname);
return GDK_FAIL;
}
} else {
-   GDKsyserror("%s: cannot create directory\n", dirname);
+   if (logerror)
+   GDKsyserror("%s: cannot create directory\n", 
dirname);
return GDK_FAIL;
}
}
@@ -1165,7 +1169,8 @@ BBPaddfarm(const char *dirname, int role
}
if (stat(bbpdir, &st) != -1 || errno != ENOENT) 
{
GDKfree(bbpdir);
-   GDKerror("%s is a database\n", dirname);
+   if (logerror)
+   GDKerror("%s is a database\n", 
dirname);
return GDK_FAIL;
}
GDKfree(bbpdir);
@@ -1175,7 +1180,8 @@ BBPaddfarm(const char *dirname, int role
}
if (stat(bbpdir, &st) != -1 || errno != ENOENT) 
{
GDKfree(bbpdir);
-   GDKerror("%s is a database\n", dirname);
+   if (logerror)
+   GDKerror("%s is a database\n", 
dirname);
return GDK_FAIL;
}
GDKfree(bbpdir);
@@ -1183,7 +1189,8 @@ BBPaddfarm(const char *dirname, int role
return GDK_SUCCEED;
}
}
-   GDKerror("too many farms\n");
+   if (logerror)
+   GDKerror("too many farms\n");
return GDK_FAIL;
 }
 
diff --git a/gdk/gdk_bbp.h b/gdk/gdk_bbp.h
--- a/gdk/gdk_bbp.h
+++ b/gdk/gdk_bbp.h
@@ -56,7 +56,7 @@
 gdk_export bat getBBPsize(void); /* current occupied size of BBP array */
 
 /* global calls */
-gdk_export gdk_return BBPaddfarm(const char *dirname, int rolemask);
+gdk_export gdk_return BBPaddfarm(const char *dirname, int rolemask, int 
logerror);
 
 /* update interface */
 gdk_export void BBPclear(bat bid);
diff --git a/tools/embedded/monetdb_embedded.c 
b/tools/embedded/monetdb_embedded.c
--- a/tools/embedded/monetdb_embedded.c
+++ b/tools/embedded/monetdb_embedded.c
@@ -459,14 +459,14 @@ monetdb_startup(char* dbdir)
goto cleanup;
}
if (!dbdir) { /* in-memory */
-   if (BBPaddfarm(NULL, (1 << PERSISTENT) | (1 << TRANSIENT)) != 
GDK_SUCCEED) {
+   if (BBPaddfarm(NULL, (1 << PERSISTENT) | (1 << TRANSIENT), 0) 
!= GDK_SUCCEED) {
mo_free_options(set, setlen);
msg = createException(MAL, "embedded.monetdb_startup", 
"Cannot add in-memory farm");
goto cleanup;
}
} else {
-   if (BBPaddfarm(dbdir, 1 << PERSISTENT) != GDK_SUCCEED ||
-   BBPaddfarm(/*dbextra ? dbextra : */dbdir, 1 << 
TRANSIENT) != GDK_SUCCEED) {
+   if (BBP

MonetDB: Jun2020 - Fixing cardinalities of complex comparison ex...

2020-06-17 Thread Pedro Ferreira
Changeset: b3cd7e622d85 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3cd7e622d85
Modified Files:
sql/server/rel_exp.c
sql/server/rel_exp.h
Branch: Jun2020
Log Message:

Fixing cardinalities of complex comparison expressions


diffs (66 lines):

diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -168,18 +168,18 @@ exp_compare(sql_allocator *sa, sql_exp *
 }
 
 sql_exp * 
-exp_compare2(sql_allocator *sa, sql_exp *l, sql_exp *r, sql_exp *h, int 
cmptype) 
+exp_compare2(sql_allocator *sa, sql_exp *l, sql_exp *r, sql_exp *f, int 
cmptype) 
 {
sql_exp *e = exp_create(sa, e_cmp);
if (e == NULL)
return NULL;
-   e->card = l->card;
+   e->card = MAX(MAX(l->card,r->card),f->card);
if (e->card == CARD_ATOM && !exp_is_atom(l))
e->card = CARD_AGGR;
e->l = l;
e->r = r;
-   if (h)
-   e->f = h;
+   assert(f);
+   e->f = f;
e->flag = cmptype;
return e;
 }
@@ -191,7 +191,7 @@ exp_filter(sql_allocator *sa, list *l, l
 
if (e == NULL)
return NULL;
-   e->card = exps_card(l);
+   e->card = MAX(exps_card(l),exps_card(r));
e->l = l;
e->r = r;
e->f = f;
@@ -204,17 +204,13 @@ exp_filter(sql_allocator *sa, list *l, l
 sql_exp *
 exp_or(sql_allocator *sa, list *l, list *r, int anti)
 {
-   sql_exp *f = NULL;
sql_exp *e = exp_create(sa, e_cmp);
 
if (e == NULL)
return NULL;
-   f = l->h?l->h->data:r->h?r->h->data:NULL;
-   e->card = l->h?exps_card(l):exps_card(r);
+   e->card = MAX(exps_card(l),exps_card(r));
e->l = l;
e->r = r;
-   assert(f);
-   e->f = f;
e->flag = cmp_or;
if (anti)
set_anti(e);
diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h
--- a/sql/server/rel_exp.h
+++ b/sql/server/rel_exp.h
@@ -31,7 +31,7 @@ extern comp_type range2rcompare( int r )
 extern int compare2range( int l, int r );
 
 extern sql_exp *exp_compare(sql_allocator *sa, sql_exp *l, sql_exp *r, int 
cmptype);
-extern sql_exp *exp_compare2(sql_allocator *sa, sql_exp *l, sql_exp *r, 
sql_exp *h, int cmptype);
+extern sql_exp *exp_compare2(sql_allocator *sa, sql_exp *l, sql_exp *r, 
sql_exp *f, int cmptype);
 extern sql_exp *exp_filter(sql_allocator *sa, list *l, list *r, sql_subfunc 
*f, int anti);
 extern sql_exp *exp_or(sql_allocator *sa, list *l, list *r, int anti);
 extern sql_exp *exp_in(sql_allocator *sa, sql_exp *l, list *r, int cmptype);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - Small fix, test for cardinality of expression...

2020-06-17 Thread Pedro Ferreira
Changeset: 1f8247547dff for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1f8247547dff
Modified Files:
sql/backends/monet5/rel_bin.c
sql/test/SQLancer/Tests/sqlancer01.sql
sql/test/SQLancer/Tests/sqlancer01.stable.out
Branch: Jun2020
Log Message:

Small fix, test for cardinality of expression, rather if the expression is an 
atom for more precise detection of select expressions inside joins


diffs (66 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -2228,11 +2228,11 @@ rel2bin_join(backend *be, sql_rel *rel, 
} else if (flag < cmp_filter && e->f) { 
/* range */
int nrcr1 = 0, nrcr2 = 0, nrcl1 
= 0, nrcl2 = 0;
if ((rel_find_exp(rel->l, e->l) 
&& !rel_find_exp(rel->r, e->l) &&
-  ((rel_find_exp(rel->r, e->r) 
&& !rel_find_exp(rel->l, e->r)) || (nrcr1 = exp_is_atom(e->r))) &&
-  ((rel_find_exp(rel->r, e->f) 
&& !rel_find_exp(rel->l, e->f)) || (nrcr2 = exp_is_atom(e->f))) && 
(nrcr1+nrcr2) <= 1) ||
+  ((rel_find_exp(rel->r, e->r) 
&& !rel_find_exp(rel->l, e->r)) || (nrcr1 = ((sql_exp*)e->r)->card == 
CARD_ATOM)) &&
+  ((rel_find_exp(rel->r, e->f) 
&& !rel_find_exp(rel->l, e->f)) || (nrcr2 = ((sql_exp*)e->f)->card == 
CARD_ATOM)) && (nrcr1+nrcr2) <= 1) ||
(rel_find_exp(rel->r, e->l) 
&& !rel_find_exp(rel->l, e->l) &&
-  ((rel_find_exp(rel->l, e->r) 
&& !rel_find_exp(rel->r, e->r)) || (nrcl1 = exp_is_atom(e->r))) &&
-  ((rel_find_exp(rel->l, e->f) 
&& !rel_find_exp(rel->r, e->f)) || (nrcl2 = exp_is_atom(e->f))) && 
(nrcl1+nrcl2) <= 1)) {
+  ((rel_find_exp(rel->l, e->r) 
&& !rel_find_exp(rel->r, e->r)) || (nrcl1 = ((sql_exp*)e->r)->card == 
CARD_ATOM)) &&
+  ((rel_find_exp(rel->l, e->f) 
&& !rel_find_exp(rel->r, e->f)) || (nrcl2 = ((sql_exp*)e->f)->card == 
CARD_ATOM)) && (nrcl1+nrcl2) <= 1)) {
append(jexps, e);
continue;
}
@@ -2246,14 +2246,14 @@ rel2bin_join(backend *be, sql_rel *rel, 
 
fll &= 
rel_find_exp(rel->l, ee) != NULL;
frl &= 
rel_find_exp(rel->r, ee) != NULL;
-   nrcl += exp_is_atom(ee);
+   nrcl += ee->card == 
CARD_ATOM;
}
for (node *n = r->h ; n ; n = 
n->next) {
sql_exp *ee = n->data;
 
flr &= 
rel_find_exp(rel->l, ee) != NULL;
frr &= 
rel_find_exp(rel->r, ee) != NULL;
-   nrcr += exp_is_atom(ee);
+   nrcr += ee->card == 
CARD_ATOM;
}
if (!((fll && flr) || (frl && 
frr)) && 
  nrcl < list_length(l) && 
nrcr < list_length(r)) {
diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -297,6 +297,7 @@ ROLLBACK;
 START TRANSACTION; -- Bug 6906
 CREATE TABLE t0("c0" DOUBLE PRECISION, "c1" VARCHAR(496));
 create view v0(c0, c1) as (select all t0.c0, r'epfNW⟚榢tptPbC{5{ZW}6,R' from 
t0) with check option;
+select 1 from v0 full outer join t0 on (cast(('a') in ('a') as string) ilike 
v0.c0);
 select sum(all + (cast(t0.c0 as int))) from v0 full outer join t0 on 
((cast((cast(v0.c1 as boolean)) not in (true, ((t0.c0)=(t0.c0)), 
cast(1745166981 as boolean)) as string))ilike(v0.c0));
 ROLLBACK;
 
diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.out 
b/sql/test/SQLancer/Tests/sqlancer01.stable.out
--- a/sql/test/SQLancer/Tests/sqlancer01.stable.out
+++ b/sql/test/SQLancer/Tests/sqlancer01.stable.out
@@ -580,6 +580,15 @@ stdout of test 'sqlancer01` in directory
 [ 1783007739   ]
 [ 498706403]
 #ROLLBACK;
+#START TRANSACTION; -- Bug 6906
+#CREATE TABLE t0("c0" DOUBLE PRECISION, "c1" V

MonetDB: default - one more saboath removed in monetdbe

2020-06-17 Thread Niels Nes
Changeset: 8b2227a9a6c3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b2227a9a6c3
Modified Files:
sql/backends/monet5/sql_scenario.c
Branch: default
Log Message:

one more saboath removed in monetdbe


diffs (12 lines):

diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -166,7 +166,7 @@ SQLprelude(Client cntxt, MalBlkPtr mb, M
fprintf(stdout, "# MonetDB/SQL module loaded\n");
fflush(stdout); /* make merovingian see this *now* */
}
-   if (GDKinmemory()) {
+   if (GDKinmemory() || GDKembedded()) {
s->name = "sql";
ms->name = "msql";
return MAL_SUCCEED;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: unlock - removed bogus limit = 0.

2020-06-17 Thread Niels Nes
Changeset: 4a1bc1a83d63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4a1bc1a83d63
Modified Files:
monetdb5/mal/mal_dataflow.c
Branch: unlock
Log Message:

removed bogus limit = 0.


diffs (11 lines):

diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -505,7 +505,6 @@ DFLOWinitialize(void)
limit = GDKnr_threads ? GDKnr_threads - 1 : 0;
if (limit > THREADS)
limit = THREADS;
-   limit = 0;
MT_lock_set(&dataflowLock);
for (i = 0; i < limit; i++) {
workers[i].errbuf = GDKmalloc(GDKMAXERRLEN);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - fix out of memory issue

2020-06-17 Thread Niels Nes
Changeset: d0cb14139aba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d0cb14139aba
Modified Files:
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_runtime.c
Branch: default
Log Message:

fix out of memory issue


diffs (33 lines):

diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -176,7 +176,7 @@ renderProfilerEvent(Client cntxt, MalBlk
if( pci->token < FCNcall || pci->token > PATcall)
logadd(",\"operator\":\"%s\"", operatorName(pci->token));
if (!GDKinmemory() && !GDKembedded()) {
-   char *uuid;
+   char *uuid = NULL;
str c;
if ((c = msab_getUUID(&uuid)) == NULL) {
logadd(",\"session\":\"%s\"", uuid);
@@ -394,7 +394,7 @@ profilerHeartbeatEvent(char *alter)
lognew();
logadd("{"); // fill in later with the event counter
if (!GDKinmemory() && !GDKembedded()) {
-   char *uuid, *err;
+   char *uuid = NULL, *err;
if ((err = msab_getUUID(&uuid)) == NULL) {
logadd("\"session\":\"%s\",", uuid);
free(uuid);
diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -177,7 +177,7 @@ runtimeProfileInit(Client cntxt, MalBlkP
QRYqueue[qhead].start = time(0);
q = isaSQLquery(mb);
QRYqueue[qhead].query = q? GDKstrdup(q):0;
-   if(QRYqueue[i].username)
+   if(QRYqueue[qhead].username)
GDKfree(QRYqueue[qhead].username);
if (!GDKembedded())
AUTHgetUsername(&QRYqueue[qhead].username, cntxt);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - New SQLancer crash

2020-06-17 Thread Pedro Ferreira
Changeset: e0d8ebdf2158 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e0d8ebdf2158
Modified Files:
sql/test/SQLancer/Tests/sqlancer01.sql
Branch: Jun2020
Log Message:

New SQLancer crash


diffs (16 lines):

diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -294,6 +294,12 @@ SELECT t0.c0 FROM t0 WHERE ((0.995239869
--  498706403
 ROLLBACK;
 
+START TRANSACTION; -- Bug 6906
+CREATE TABLE t0("c0" DOUBLE PRECISION, "c1" VARCHAR(496));
+create view v0(c0, c1) as (select all t0.c0, r'epfNW⟚榢tptPbC{5{ZW}6,R' from 
t0) with check option;
+select sum(all + (cast(t0.c0 as int))) from v0 full outer join t0 on 
((cast((cast(v0.c1 as boolean)) not in (true, ((t0.c0)=(t0.c0)), 
cast(1745166981 as boolean)) as string))ilike(v0.c0));
+ROLLBACK;
+
 DROP TABLE tbl_ProductSales;
 DROP TABLE another_T;
 DROP TABLE integers;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - Bug 6905 was fixed by recent changes

2020-06-17 Thread Pedro Ferreira
Changeset: 8b7b7e2b98e8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b7b7e2b98e8
Modified Files:
sql/test/SQLancer/Tests/sqlancer01.stable.out
Branch: Jun2020
Log Message:

Bug 6905 was fixed by recent changes


diffs (60 lines):

diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.out 
b/sql/test/SQLancer/Tests/sqlancer01.stable.out
--- a/sql/test/SQLancer/Tests/sqlancer01.stable.out
+++ b/sql/test/SQLancer/Tests/sqlancer01.stable.out
@@ -530,6 +530,56 @@ stdout of test 'sqlancer01` in directory
 [ NULL ]
 [ NULL ]
 #ROLLBACK;
+#START TRANSACTION; -- Bug 6905
+#CREATE TABLE "sys"."t0" ("c0" INTEGER,"c1" DOUBLE);
+#COPY 15 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+#-1498252621   -1498252621
+#0 NULL
+#-539579569-539579569
+#-108613919NULL
+#0 0
+#8 NULL
+#1783007739NULL
+#498706403 NULL
+#0 0.6103170716911988
+#14938543160.6198781779645515
+#-1608947797   1
+#1 0.8356779050811012
+#-1018686230.16442926747225173
+#1493854316-1498252621
+#1 0.9401903184230552
+[ 15   ]
+#SELECT t0.c0 FROM t0 WHERE (0.9952398693354088) IN (t0.c1, t0.c1);
+% sys.t0 # table_name
+% c0 # name
+% int # type
+% 1 # length
+#SELECT ALL t0.c0 FROM t0 WHERE NOT ((0.9952398693354088) IN (t0.c1, t0.c1));
+% sys.t0 # table_name
+% c0 # name
+% int # type
+% 11 # length
+[ -1498252621  ]
+[ -539579569   ]
+[ 0]
+[ 0]
+[ 1493854316   ]
+[ -1608947797  ]
+[ 1]
+[ -101868623   ]
+[ 1493854316   ]
+[ 1]
+#SELECT t0.c0 FROM t0 WHERE ((0.9952398693354088) IN (t0.c1, t0.c1)) IS NULL;
+% sys.t0 # table_name
+% c0 # name
+% int # type
+% 10 # length
+[ 0]
+[ -108613919   ]
+[ 8]
+[ 1783007739   ]
+[ 498706403]
+#ROLLBACK;
 #DROP TABLE tbl_ProductSales;
 #DROP TABLE another_T;
 #DROP TABLE integers;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - Fix for SQLancer query, if a query has an exp...

2020-06-17 Thread Pedro Ferreira
Changeset: 9a90e3dd8edf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9a90e3dd8edf
Modified Files:
sql/server/rel_select.c

sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out
sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out
sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out

sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
sql/test/BugTracker-2018/Tests/convert-key.Bug-6648.stable.out
sql/test/BugTracker-2019/Tests/cast-interval.Bug-6793.stable.out
sql/test/BugTracker/Tests/convert_dec2varchar.SF-1774312.stable.out
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/SQLancer/Tests/sqlancer01.sql
sql/test/SQLancer/Tests/sqlancer01.stable.err
sql/test/SQLancer/Tests/sqlancer01.stable.out
sql/test/bugs/Tests/cast_varchar2int-bug-sf-964165.stable.out
sql/test/mergetables/Tests/mergeinit.stable.err
sql/test/miscellaneous/Tests/groupings.stable.out
sql/test/miscellaneous/Tests/simple_selects.stable.out
sql/test/pg_regress/Tests/date.stable.out
sql/test/pg_regress/Tests/int8.stable.out
sql/test/pg_regress/Tests/int8.stable.out.int128
Branch: Jun2020
Log Message:

Fix for SQLancer query, if a query has an explicit cast a generated label must 
be used, so optimizers won't get confused


diffs (truncated from 12424 to 300 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
@@ -4145,6 +4145,8 @@ rel_cast(sql_query *query, sql_rel **rel
}
if (e) 
e = rel_check_type(sql, tpe, rel ? *rel : NULL, e, type_cast);
+   if (e && e->type == e_convert)
+   exp_label(sql->sa, e, ++sql->label);
return e;
 }
 
diff --git 
a/sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out 
b/sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out
--- a/sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out
+++ b/sql/test/BugTracker-2008/Tests/decimal_cast_in_view.SF-2075223.stable.out
@@ -29,8 +29,8 @@ stdout of test 'decimal_cast_in_view.SF-
 % 10 # length
 [ " 54."   ]
 #select CAST (a as NUMERIC (5, 2)) from A;
-% sys.a # table_name
-% a # name
+% sys.%1 # table_name
+% %1 # name
 % decimal # type
 % 7 # length
 [ 54.00]
diff --git a/sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out 
b/sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out
--- a/sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out
+++ b/sql/test/BugTracker-2014/Tests/missing_alias.Bug-3626.stable.out
@@ -29,8 +29,8 @@ stdout of test 'missing_alias.Bug-3626` 
 #insert into test2 values (1, true);
 [ 1]
 #select cast(b as smallint), (i > 0 and b) from test2;
-% sys.test2,   sys. # table_name
-% b,   %2 # name
+% sys.%1,  sys.%2 # table_name
+% %1,  %2 # name
 % smallint,boolean # type
 % 1,   5 # length
 [ 1,   true]
diff --git a/sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out 
b/sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out
--- a/sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out
+++ b/sql/test/BugTracker-2015/Tests/string-to-inet.Bug-3666.stable.out
@@ -63,8 +63,8 @@ stdout of test 'string-to-inet.Bug-3666`
 #insert into iptable values ('192.168.10.2');
 [ 1]
 #select cast(textip as inet) from iptable;
-% sys.iptable # table_name
-% textip # name
+% sys.%1 # table_name
+% %1 # name
 % inet # type
 % 0 # length
 [ 192.168.0.1  ]
diff --git 
a/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
 
b/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
--- 
a/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
+++ 
b/sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
@@ -82,8 +82,8 @@ stdout of test 'convert-function-test-hg
 [ 32767]
 [ 2147483647   ]
 #SELECT v, convert(v, boolean) from T_hugeint;
-% sys.t_hugeint,   sys.t_hugeint # table_name
-% v,   v # name
+% sys.t_hugeint,   sys.%1 # table_name
+% v,   %1 # name
 % hugeint, boolean # type
 % 11,  5 # length
 [ 1,   true]
@@ -97,8 +97,8 @@ stdout of test 'convert-function-test-hg
 [ 2147483647,  true]
 [ NULL,NULL]
 #SELECT v, convert(v, tinyint) from T_hugeint where v between -127 and 127;
-% sys.t_hugeint,   sys.t_hugeint # table_name
-% v,   v # name
+% sys.t_hugeint,   sys.%1 # table_name
+% v,   %1 # name
 % hugeint, tinyint # type
 % 4,   4 # length
 [ 1,   1   ]
@@ -107,8 +107,8

MonetDB: Jun2020 - Don't make UUIDs go through a 32 bit bottlene...

2020-06-17 Thread Sjoerd Mullender
Changeset: 7a4e53e8a05d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7a4e53e8a05d
Modified Files:
gdk/gdk_hash.c
monetdb5/modules/atoms/uuid.c
Branch: Jun2020
Log Message:

Don't make UUIDs go through a 32 bit bottleneck when calculating a hash.


diffs (73 lines):

diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -97,7 +97,11 @@ HASHclear(Hash *h)
memset(h->Bckt, 0xFF, h->nbucket * h->width);
 }
 
-#define HASH_VERSION   3
+#define HASH_VERSION   4
+/* this is only for the change of hash function of the UUID type; if
+ * HASH_VERSION is increased again from 4, the code associated with
+ * HASH_VERSION_NOUUID must be deleted */
+#define HASH_VERSION_NOUUID3
 #define HASH_HEADER_SIZE   7   /* nr of size_t fields in header */
 
 static void
@@ -442,11 +446,21 @@ BATcheckhash(BAT *b)
struct stat st;
 
if (read(fd, hdata, sizeof(hdata)) == 
sizeof(hdata) &&
-   hdata[0] == (
+   (hdata[0] == (
 #ifdef PERSISTENTHASH
((size_t) 1 << 24) |
 #endif
-   HASH_VERSION) &&
+   HASH_VERSION)
+#ifdef HASH_VERSION_NOUUID
+/* if not uuid, also allow 
previous version */
+|| (hdata[0] == (
+#ifdef PERSISTENTHASH
+((size_t) 1 << 24) |
+#endif
+HASH_VERSION_NOUUID) &&
+strcmp(ATOMname(b->ttype), 
"uuid") != 0)
+#endif
+   ) &&
hdata[1] > 0 &&
hdata[4] == (size_t) BATcount(b) &&
fstat(fd, &st) == 0 &&
diff --git a/monetdb5/modules/atoms/uuid.c b/monetdb5/modules/atoms/uuid.c
--- a/monetdb5/modules/atoms/uuid.c
+++ b/monetdb5/modules/atoms/uuid.c
@@ -319,17 +319,19 @@ BUN
 UUIDhash(const void *v)
 {
const uuid *u = (const uuid *) v;
-   unsigned int u1, u2, u3, u4;
+   ulng u1, u2;
 
-   u1 = (unsigned int) u->u[0] << 24 | (unsigned int) u->u[1] << 16 |
-   (unsigned int) u->u[2] << 8 | (unsigned int) u->u[3];
-   u2 = (unsigned int) u->u[4] << 24 | (unsigned int) u->u[5] << 16 |
-   (unsigned int) u->u[6] << 8 | (unsigned int) u->u[7];
-   u3 = (unsigned int) u->u[8] << 24 | (unsigned int) u->u[9] << 16 |
-   (unsigned int) u->u[10] << 8 | (unsigned int) u->u[11];
-   u4 = (unsigned int) u->u[12] << 24 | (unsigned int) u->u[13] << 16 |
-   (unsigned int) u->u[14] << 8 | (unsigned int) u->u[15];
-   return (BUN) mix_int(u1 ^ u2 ^ u3 ^ u4);
+   u1 = (ulng) u->u[0] << 56 | (ulng) u->u[1] << 48 |
+   (ulng) u->u[2] << 40 | (ulng) u->u[3] << 32 |
+   (ulng) u->u[4] << 24 | (ulng) u->u[5] << 16 |
+   (ulng) u->u[6] << 8 | (ulng) u->u[7];
+   u2 = (ulng) u->u[8] << 56 | (ulng) u->u[9] << 48 |
+   (ulng) u->u[10] << 40 | (ulng) u->u[11] << 32 |
+   (ulng) u->u[12] << 24 | (ulng) u->u[13] << 16 |
+   (ulng) u->u[14] << 8 | (ulng) u->u[15];
+   /* we're not using mix_hge since this we way get the same result
+* on systems with and without 128 bit integer support */
+   return (BUN) (mix_lng(u1) ^ mix_lng(u2));
 }
 
 const uuid *
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: unlock - Implemented reference counting on heaps (theap...

2020-06-17 Thread Sjoerd Mullender
Changeset: caacb8c7f26c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=caacb8c7f26c
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_project.c
gdk/gdk_select.c
gdk/gdk_storage.c
sql/backends/monet5/sql.c
Branch: unlock
Log Message:

Implemented reference counting on heaps (theap and tvheap).

Next step is using this for safer growth of parent heaps.


diffs (truncated from 669 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
@@ -327,6 +327,7 @@ BUN HASHprobe(const Hash *h, const void 
 void HEAP_free(Heap *heap, var_t block);
 void HEAP_initialize(Heap *heap, size_t nbytes, size_t nprivate, int 
alignment);
 var_t HEAP_malloc(Heap *heap, size_t nbytes);
+void HEAPdecref(Heap *h, bool remove);
 gdk_return HEAPextend(Heap *h, size_t size, bool mayshare) 
__attribute__((__warn_unused_result__));
 size_t HEAPmemsize(Heap *h);
 size_t HEAPvmsize(Heap *h);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -528,10 +528,12 @@ typedef struct {
char filename[40];  /* file containing image of the heap */
 #endif
 
+   ATOMIC_TYPE refs;   /* reference count for this heap */
bte farmid; /* id of farm where heap is located */
bool hashash:1, /* the string heap contains hash values */
cleanhash:1,/* string heaps must clean hash */
-   dirty:1;/* specific heap dirty marker */
+   dirty:1,/* specific heap dirty marker */
+   remove:1;   /* remove storage file when freeing */
storage_t storage;  /* storage mode (mmap/malloc). */
storage_t newstorage;   /* new desired storage mode at re-allocation. */
bat parentid;   /* cache id of VIEW parent bat */
@@ -740,6 +742,7 @@ typedef struct BAT {
 
/* dynamic column properties */
COLrec T;   /* column info */
+   MT_Lock theaplock;  /* lock protecting heap reference changes */
 
MT_Lock batIdxLock; /* lock to manipulate indexes */
 } BAT;
@@ -814,6 +817,7 @@ gdk_export gdk_return HEAPextend(Heap *h
__attribute__((__warn_unused_result__));
 gdk_export size_t HEAPvmsize(Heap *h);
 gdk_export size_t HEAPmemsize(Heap *h);
+gdk_export void HEAPdecref(Heap *h, bool remove);
 
 /*
  * @- Internal HEAP Chunk Management
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -107,7 +107,12 @@ VIEWcreate(oid seq, BAT *b)
bn->batInserted = b->batInserted;
bn->batCount = b->batCount;
bn->batCapacity = b->batCapacity;
+   MT_lock_set(&b->theaplock);
bn->T = b->T;
+   (void) ATOMIC_INC(&b->theap->refs);
+   if (b->tvheap)
+   (void) ATOMIC_INC(&b->tvheap->refs);
+   MT_lock_unset(&b->theaplock);
 
if (tp)
BBPshare(tp);
@@ -129,8 +134,12 @@ VIEWcreate(oid seq, BAT *b)
if (BBPcacheit(bn, true) != GDK_SUCCEED) {  /* enter in BBP */
if (tp)
BBPunshare(tp);
-   if (bn->tvheap)
+   if (bn->tvheap) {
BBPunshare(bn->tvheap->parentid);
+   HEAPdecref(bn->tvheap, false);
+   }
+   HEAPdecref(bn->theap, false);
+   MT_lock_destroy(&bn->theaplock);
MT_lock_destroy(&bn->batIdxLock);
GDKfree(bn);
return NULL;
@@ -149,28 +158,28 @@ VIEWcreate(oid seq, BAT *b)
 gdk_return
 BATmaterialize(BAT *b)
 {
-   int tt;
BUN cnt;
-   Heap tail;
+   Heap *tail;
BUN p, q;
oid t, *x;
 
BATcheck(b, GDK_FAIL);
assert(!isVIEW(b));
-   tt = b->ttype;
+   if (b->ttype != TYPE_void) {
+   /* no voids */
+   return GDK_SUCCEED;
+   }
+
cnt = BATcapacity(b);
-   tail = *b->theap;
+   if ((tail = GDKmalloc(sizeof(Heap))) == NULL)
+   return GDK_FAIL;
+   *tail = *b->theap;
+   ATOMIC_INIT(&tail->refs, 1);
p = 0;
q = BUNlast(b);
assert(cnt >= q - p);
TRC_DEBUG(ALGO, "BATmaterialize(" ALGOBATFMT ")\n", ALGOBATPAR(b));
 
-   if (tt != TYPE_void) {
-   /* no voids */
-   return GDK_SUCCEED;
-   }
-   tt = TYPE_oid;
-
/* cleanup possible ACC's */
HASHdestroy(b);
IMPSdestroy(b);
@@ -178,13 +187,17 @@ BATmaterialize(BAT *b)
 
strconcat_len(b->theap->filename, sizeof(b->theap->filename),
  BBP_physical(b->batCacheid), ".tail", NULL);
-   if (HEAPalloc(b->theap, cnt, sizeof(oid)) != GDK_SUCCEED) {
-   *

MonetDB: unlock - Some simple approvals.

2020-06-17 Thread Sjoerd Mullender
Changeset: a2657c1565cd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2657c1565cd
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.int128
Branch: unlock
Log Message:

Some simple approvals.


diffs (truncated from 14651 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
@@ -6876,31 +6876,31 @@ stdout of test 'MAL-signatures` in direc
 [ "batcolor",  "ycc",  "command batcolor.ycc(X_1:bat[:flt], X_2:bat[:flt], 
X_3:bat[:flt]):bat[:color] ",   "CLRbatycc;",   ""  ]
 [ "batgeom",   "AsEWKT",   "function 
batgeom.AsEWKT(w:bat[:wkb]):bat[:str];",  "", ""  ]
 [ "batgeom",   "AsText",   "function 
batgeom.AsText(w:bat[:wkb]):bat[:str];",  "", ""  ]
-[ "batgeom",   "Boundary", "command 
batgeom.Boundary(w:bat[:wkb]):bat[:wkb] ", "wkbBoundary_bat;", ""  ]
-[ "batgeom",   "Contains", "command batgeom.Contains(a:bat[:wkb], 
b:bat[:wkb]):bat[:bit] ","wkbContains_bat;", ""  ]
-[ "batgeom",   "Contains", "command batgeom.Contains(a:bat[:wkb], 
b:wkb):bat[:bit] ",  "wkbContains_bat_geom;",""  ]
-[ "batgeom",   "Contains", "command batgeom.Contains(a:wkb, 
b:bat[:wkb]):bat[:bit] ",  "wkbContains_geom_bat;",""  ]
-[ "batgeom",   "Dimension","command 
batgeom.Dimension(w:bat[:wkb]):bat[:int] ","wkbDimension_bat;",""  ]
-[ "batgeom",   "Distance", "command batgeom.Distance(a:bat[:wkb], 
b:bat[:wkb]):bat[:dbl] ","wkbDistance_bat;", ""  ]
-[ "batgeom",   "Distance", "command batgeom.Distance(a:bat[:wkb], 
b:wkb):bat[:dbl] ",  "wkbDistance_bat_geom;",""  ]
-[ "batgeom",   "Distance", "command batgeom.Distance(a:wkb, 
b:bat[:wkb]):bat[:dbl] ",  "wkbDistance_geom_bat;",""  ]
-[ "batgeom",   "Filter",   "command batgeom.Filter(a:bat[:wkb], 
b:wkb):bat[:wkb] ","wkbFilter_bat_geom;",  ""  ]
-[ "batgeom",   "Filter",   "command batgeom.Filter(a:wkb, 
b:bat[:wkb]):bat[:wkb] ","wkbFilter_geom_bat;",  "Filters the points in 
the bats according to the MBR of the other bat." ]
-[ "batgeom",   "FromText", "command batgeom.FromText(wkt:bat[:str], 
srid:int, type:int):bat[:wkb] ",   "wkbFromText_bat;", ""  ]
+[ "batgeom",   "Boundary", "command 
batgeom.Boundary(X_1:bat[:wkb]):bat[:wkb] ",   "wkbBoundary_bat;", ""  ]
+[ "batgeom",   "Contains", "command batgeom.Contains(X_1:bat[:wkb], 
X_2:bat[:wkb]):bat[:bit] ","wkbContains_bat;", ""  ]
+[ "batgeom",   "Contains", "command batgeom.Contains(X_1:bat[:wkb], 
X_2:wkb):bat[:bit] ",  "wkbContains_bat_geom;",""  ]
+[ "batgeom",   "Contains", "command batgeom.Contains(X_1:wkb, 
X_2:bat[:wkb]):bat[:bit] ",  "wkbContains_geom_bat;",""  ]
+[ "batgeom",   "Dimension","command 
batgeom.Dimension(X_1:bat[:wkb]):bat[:int] ",  "wkbDimension_bat;",""  ]
+[ "batgeom",   "Distance", "command batgeom.Distance(X_1:bat[:wkb], 
X_2:bat[:wkb]):bat[:dbl] ","wkbDistance_bat;", ""  ]
+[ "batgeom",   "Distance", "command batgeom.Distance(X_1:bat[:wkb], 
X_2:wkb):bat[:dbl] ",  "wkbDistance_bat_geom;",""  ]
+[ "batgeom",   "Distance", "command batgeom.Distance(X_1:wkb, 
X_2:bat[:wkb]):bat[:dbl] ",  "wkbDistance_geom_bat;",""  ]
+[ "batgeom",   "Filter",   "command batgeom.Filter(X_1:bat[:wkb], 
X_2:wkb):bat[:wkb] ","wkbFilter_bat_geom;",  ""  ]
+[ "batgeom",   "Filter",   "command batgeom.Filter(X_1:wkb, 
X_2:bat[:wkb]):bat[:wkb] ","wkbFilter_geom_bat;",  ""  ]
+[ "batgeom",   "FromText", "command batgeom.FromText(X_1:bat[:str], 
X_2:int, X_3:int):bat[:wkb] ", "wkbFromText_bat;", ""  ]
 [ "batgeom",   "GeomCollFromText", "function 
batgeom.GeomCollFromText(wkt:bat[:str]):bat[:wkb];",  "", ""  ]
 [ "batgeom",   "GeomCollFromText", "function 
batgeom.GeomCollFromText(wkt:bat[:str], srid:int):bat[:wkb];","", 
""  ]
 [ "batgeom",   "GeomFromText", "function 
batgeom.GeomFromText(wkt:bat[:str]):bat[:wkb];",  "", ""  ]
 [ "batgeom",   "GeomFromText", "function batgeom.GeomFromText(wkt:bat[:str], 
srid:int):bat[:wkb];","", ""  ]
-[ "batgeom",   "GeometryN","command batgeom.GeometryN(w:bat[:wkb], 
n:int):bat[:wkb] ", "wkbGeometryN_bat;","Returns the 1-based Nth 
geometry if the geometry is a GEOMETRYCOLLECTION, (MULTI)POINT, 
(MULTI)LINESTRING, MULTICURVE or (MULTI)POLYGON. Otherwise, return NULL"   ]
-[ "batgeom",   "GeometryType", "command batgeom.GeometryType(w:bat[:wkb], 
flag:int):bat[:str] ",   "wkbGeometryType_bat;", ""