Changeset: d5d98fd1535d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d5d98fd1535d
Modified Files:
        cmake/monetdb-findpackages.cmake
        testing/Mtest.py.in
Branch: pp_hashjoin
Log Message:

merged with default


diffs (truncated from 1036 to 300 lines):

diff --git a/cmake/Modules/FindNumPy.cmake b/cmake/Modules/FindNumPy.cmake
deleted file mode 100644
--- a/cmake/Modules/FindNumPy.cmake
+++ /dev/null
@@ -1,92 +0,0 @@
-# - Find the NumPy libraries
-# This module finds if NumPy is installed, and sets the following variables
-# indicating where it is.
-#
-# TODO: Update to provide the libraries and paths for linking npymath lib.
-#
-#  NUMPY_FOUND               - was NumPy found
-#  NUMPY_VERSION             - the version of NumPy found as a string
-#  NUMPY_VERSION_MAJOR       - the major version number of NumPy
-#  NUMPY_VERSION_MINOR       - the minor version number of NumPy
-#  NUMPY_VERSION_PATCH       - the patch version number of NumPy
-#  NUMPY_VERSION_DECIMAL     - e.g. version 1.6.1 is 10601
-#  NUMPY_INCLUDE_DIRS        - path to the NumPy include files
-
-#============================================================================
-# Copyright 2012 Continuum Analytics, Inc.
-#
-# MIT License
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files
-# (the "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to permit
-# persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-# 
-#============================================================================
-
-# Finding NumPy involves calling the Python interpreter
-if(NumPy_FIND_REQUIRED)
-    find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
-else()
-  find_package(Python3 COMPONENTS Interpreter Development)
-endif()
-
-if(NOT PYTHONINTERP_FOUND)
-    set(NUMPY_FOUND FALSE)
-endif()
-
-execute_process(COMMAND "${Python3_EXECUTABLE}" "-c"
-    "import numpy as n; print(n.__version__); print(n.get_include());"
-    RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS
-    OUTPUT_VARIABLE _NUMPY_VALUES
-    ERROR_VARIABLE _NUMPY_ERROR_VALUE
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0)
-    if(NumPy_FIND_REQUIRED)
-        message(FATAL_ERROR
-            "NumPy import failure:\n${_NUMPY_ERROR_VALUE}")
-    endif()
-    set(NUMPY_FOUND FALSE)
-else()
-    # Convert the process output into a list
-    string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES})
-    string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES})
-    list(GET _NUMPY_VALUES 0 NUMPY_VERSION)
-    list(GET _NUMPY_VALUES 1 NUMPY_INCLUDE_DIRS)
-
-    # Make sure all directory separators are '/'
-    string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS})
-
-    # Get the major and minor version numbers
-    string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION})
-    list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR)
-    list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR)
-    list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH)
-    string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH})
-    math(EXPR NUMPY_VERSION_DECIMAL
-        "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + 
${NUMPY_VERSION_PATCH}")
-
-    find_package_message(NUMPY
-        "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}"
-        "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}")
-
-    set(NUMPY_FOUND TRUE)
-    if(NUMPY_FOUND)
-      set(Python3_NumPy_FOUND 1)
-    endif()
-endif()
diff --git a/cmake/monetdb-findpackages.cmake b/cmake/monetdb-findpackages.cmake
--- a/cmake/monetdb-findpackages.cmake
+++ b/cmake/monetdb-findpackages.cmake
@@ -25,12 +25,7 @@ find_path(XXHASH_INCLUDE_DIR NAMES xxhas
   ${PC_XXHASH_INCLUDE_DIRS}
 )
 
-if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
-  find_package(Python3 COMPONENTS Interpreter Development)
-  find_package(NumPy)
-else()
-  find_package(Python3 COMPONENTS Interpreter Development NumPy)
-endif()
+find_package(Python3 COMPONENTS Interpreter Development)
 
 if(WITH_RTREE)
   find_package(RTree)
diff --git a/cmake/monetdb-functions.cmake b/cmake/monetdb-functions.cmake
--- a/cmake/monetdb-functions.cmake
+++ b/cmake/monetdb-functions.cmake
@@ -74,11 +74,6 @@ function(monetdb_cmake_summary)
   message(STATUS "-----------------------------------------")
   message(STATUS "System is big endian: ${IS_BIG_ENDIAN}")
   message(STATUS "Toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
-  if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
-    message(STATUS "NumPy include dirs: ${NUMPY_INCLUDE_DIRS}")
-  else()
-    message(STATUS "Numpy target: ")
-  endif()
   message(STATUS "System name: ${CMAKE_SYSTEM_NAME}")
   message(STATUS "System version: ${CMAKE_SYSTEM_VERSION}")
   if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
diff --git a/debian/copyright b/debian/copyright
--- a/debian/copyright
+++ b/debian/copyright
@@ -146,10 +146,6 @@ License: permissive
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.
 
-Files: cmake/Modules/FindNumPy.cmake
-Copyright: 2012 Continuum Analytics, Inc.
-License: MIT
-
 Files: cmake/Modules/FindPCRE.cmake
 Copyright: 2007-2009 LuaDist.
 License: MIT
diff --git a/documentation/source/cmake.rst b/documentation/source/cmake.rst
--- a/documentation/source/cmake.rst
+++ b/documentation/source/cmake.rst
@@ -154,11 +154,6 @@ Unspecified
 ``Legacy``
 ==========
 
-Numpy detection
-===============
-
-Since the Python3::Numpy target is not available before version 3.14, we need 
an alternative. We use a NumPy detection function from a github project: 
https://raw.githubusercontent.com/fperazzi/davis-2017/master/cmake/FindNumPy.cmake
 This is MIT licensed, so we can include this in MonetDB. We change the python 
detection to detect python3, instead of python2.
-
 shp.h define conflicts
 ======================
 
diff --git 
a/sql/test/BugTracker-2026/Tests/7963-having-sum-or-exists-or-sum-bug.test 
b/sql/test/BugTracker-2026/Tests/7963-having-sum-or-exists-or-sum-bug.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7963-having-sum-or-exists-or-sum-bug.test
@@ -0,0 +1,73 @@
+statement ok
+CREATE TABLE rift_min_a (
+  g INT,
+  x INT
+)
+
+statement ok
+CREATE TABLE rift_min_b (
+  y INT
+)
+
+statement ok
+INSERT INTO rift_min_a VALUES
+  (1, 10),
+  (1, 20),
+  (2, 100)
+
+statement ok
+INSERT INTO rift_min_b VALUES
+  (1)
+
+-- Control query 1: succeeds.
+query II rowsort
+SELECT SUM(x) AS s, g
+FROM rift_min_a
+GROUP BY g
+HAVING EXISTS(SELECT 1 FROM rift_min_b) OR SUM(x) < 81
+----
+100
+2
+30
+1
+
+-- Control query 2: succeeds.
+query II rowsort
+SELECT SUM(x) AS s, g
+FROM rift_min_a
+GROUP BY g
+HAVING SUM(x) < 81 OR EXISTS(SELECT 1 FROM rift_min_b)
+----
+100
+2
+30
+1
+
+-- Control query 3: succeeds.
+query II rowsort
+SELECT SUM(x) AS s, g
+FROM rift_min_a
+GROUP BY g
+HAVING SUM(x) < 81 OR SUM(x) < 81
+----
+30
+1
+
+-- Failing query: should also be valid, but MonetDB rejects it.
+query II rowsort
+SELECT SUM(x) AS s, g
+FROM rift_min_a
+GROUP BY g
+HAVING SUM(x) < 81 OR EXISTS(SELECT 1 FROM rift_min_b) OR SUM(x) < 81
+----
+100
+2
+30
+1
+
+statement ok
+DROP TABLE IF EXISTS rift_min_b
+
+statement ok
+DROP TABLE IF EXISTS rift_min_a
+
diff --git a/sql/test/BugTracker-2026/Tests/7964-optimize-limit-0-queries.test 
b/sql/test/BugTracker-2026/Tests/7964-optimize-limit-0-queries.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7964-optimize-limit-0-queries.test
@@ -0,0 +1,166 @@
+statement ok
+CREATE TABLE rift_digit (
+  d INT
+)
+
+statement ok
+INSERT INTO rift_digit VALUES
+  (0), (1), (2), (3), (4),
+  (5), (6), (7), (8), (9)
+
+statement ok
+CREATE TABLE rift_perf_a AS
+SELECT
+  d1.d * 1000 + d2.d * 100 + d3.d * 10 + d4.d AS id,
+  d1.d AS k,
+  'payload' AS payload
+FROM rift_digit AS d1,
+     rift_digit AS d2,
+     rift_digit AS d3,
+     rift_digit AS d4
+WITH DATA
+
+statement ok
+CREATE TABLE rift_perf_b AS
+SELECT
+  d1.d * 1000 + d2.d * 100 + d3.d * 10 + d4.d AS id,
+  d4.d AS k,
+  'payload' AS payload
+FROM rift_digit AS d1,
+     rift_digit AS d2,
+     rift_digit AS d3,
+     rift_digit AS d4
+WITH DATA
+
+query I nosort
+SELECT COUNT(*) FROM rift_perf_a
+----
+10000
+
+query I nosort
+SELECT COUNT(*) FROM rift_perf_b
+----
+10000
+
+-- Original query: returns zero rows because of LIMIT 0.
+-- In my test this query still kept a join plan.
+query IIT nosort
+SELECT
+  a.id AS aid,
+  b.id AS bid,
+  a.payload AS p
+FROM rift_perf_a AS a
+JOIN rift_perf_b AS b
+  ON a.k <> b.k
+WHERE a.id < 1000
+  AND b.id < 1000
+  AND (
+    a.k >= 0
+    OR EXISTS(SELECT 1 FROM rift_digit WHERE d = 1)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to