parent
							
								
									ece2a6cc9f
								
							
						
					
					
						commit
						5b1bbf0f99
					
				| @ -0,0 +1,222 @@ | ||||
| { | ||||
|   "stmts": { | ||||
|     "udf": { | ||||
|       "fname": "covariances2", | ||||
|       "params": ["x", "y", "w"], | ||||
|       "stmt": [{ | ||||
|         "assignment": { | ||||
|           "var": "xmeans", | ||||
|           "op": ":=", | ||||
|           "expr": 0.0 | ||||
|         } | ||||
|       }, { | ||||
|         "assignment": { | ||||
|           "var": "ymeans", | ||||
|           "op": ":=", | ||||
|           "expr": 0.0 | ||||
|         } | ||||
|       }, { | ||||
|         "assignment": { | ||||
|           "var": "l", | ||||
|           "op": ":=", | ||||
|           "expr": "_builtin_len" | ||||
|         } | ||||
|       }, { | ||||
|         "if": { | ||||
|           "cond": { | ||||
|             "gt": ["w", "l"] | ||||
|           }, | ||||
|           "assignment": { | ||||
|             "var": "w", | ||||
|             "op": ":=", | ||||
|             "expr": "l" | ||||
|           }, | ||||
|           "elif": [{ | ||||
|             "cond": { | ||||
|               "gt": ["w", { | ||||
|                 "add": ["l", 2] | ||||
|               }] | ||||
|             }, | ||||
|             "stmt": [{ | ||||
|               "assignment": { | ||||
|                 "var": "l", | ||||
|                 "op": ":=", | ||||
|                 "expr": 3 | ||||
|               } | ||||
|             }, { | ||||
|               "assignment": { | ||||
|                 "var": "w", | ||||
|                 "op": ":=", | ||||
|                 "expr": 4 | ||||
|               } | ||||
|             }] | ||||
|           }, { | ||||
|             "cond": { | ||||
|               "lt": ["w", 99] | ||||
|             }, | ||||
|             "stmt": { | ||||
|               "assignment": { | ||||
|                 "var": "l", | ||||
|                 "op": ":=", | ||||
|                 "expr": 8 | ||||
|               } | ||||
|             } | ||||
|           }, { | ||||
|             "cond": { | ||||
|               "lt": ["w", 999] | ||||
|             }, | ||||
|             "assignment": { | ||||
|               "var": "w", | ||||
|               "op": ":=", | ||||
|               "expr": 6 | ||||
|             } | ||||
|           }], | ||||
|           "else": { | ||||
|             "assignment": { | ||||
|               "var": "l", | ||||
|               "op": ":=", | ||||
|               "expr": { | ||||
|                 "div": ["l", 2] | ||||
|               } | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|       }, { | ||||
|         "for": { | ||||
|           "defs": { | ||||
|             "var": ["i", "j"], | ||||
|             "op": [":=", ":="], | ||||
|             "expr": [0, 0] | ||||
|           }, | ||||
|           "cond": { | ||||
|             "lt": ["i", "w"] | ||||
|           }, | ||||
|           "tail": { | ||||
|             "var": "i", | ||||
|             "op": ":=", | ||||
|             "expr": { | ||||
|               "add": ["i", 1] | ||||
|             } | ||||
|           }, | ||||
|           "stmt": [{ | ||||
|             "assignment": { | ||||
|               "var": "xmeans", | ||||
|               "op": "+=", | ||||
|               "expr": { | ||||
|                 "get": ["x", "i"] | ||||
|               } | ||||
|             } | ||||
|           }, { | ||||
|             "assignment": { | ||||
|               "var": "ymeans", | ||||
|               "op": "+=", | ||||
|               "expr": { | ||||
|                 "get": ["y", "i"] | ||||
|               } | ||||
|             } | ||||
|           }, { | ||||
|             "assignment": { | ||||
|               "var": { | ||||
|                 "get": ["_builtin_ret", "i"] | ||||
|               }, | ||||
|               "op": ":=", | ||||
|               "expr": { | ||||
|                 "avg": { | ||||
|                   "mul": [{ | ||||
|                     "sub": [{ | ||||
|                       "x": [{ | ||||
|                         "sub": ["l", "w"] | ||||
|                       }, "l"] | ||||
|                     }, "xmeans"] | ||||
|                   }, { | ||||
|                     "sub": [{ | ||||
|                       "y": [{ | ||||
|                         "sub": ["l", "w"] | ||||
|                       }, "l"] | ||||
|                     }, "ymeans"] | ||||
|                   }] | ||||
|                 } | ||||
|               } | ||||
|             } | ||||
|           }] | ||||
|         } | ||||
|       }, { | ||||
|         "for": { | ||||
|           "defs": { | ||||
|             "var": "i", | ||||
|             "op": ":=", | ||||
|             "expr": 0 | ||||
|           }, | ||||
|           "cond": { | ||||
|             "lt": ["i", "l"] | ||||
|           }, | ||||
|           "tail": { | ||||
|             "var": "i", | ||||
|             "op": "+=", | ||||
|             "expr": 1 | ||||
|           }, | ||||
|           "stmt": [{ | ||||
|             "assignment": { | ||||
|               "var": "xmeans", | ||||
|               "op": "+=", | ||||
|               "expr": { | ||||
|                 "div": [{ | ||||
|                   "sub": [{ | ||||
|                     "get": ["x", "i"] | ||||
|                   }, { | ||||
|                     "get": ["x", { | ||||
|                       "sub": ["i", "w"] | ||||
|                     }] | ||||
|                   }] | ||||
|                 }, "w"] | ||||
|               } | ||||
|             } | ||||
|           }, { | ||||
|             "assignment": { | ||||
|               "var": "ymeans", | ||||
|               "op": "+=", | ||||
|               "expr": { | ||||
|                 "div": [{ | ||||
|                   "sub": [{ | ||||
|                     "get": ["y", "i"] | ||||
|                   }, { | ||||
|                     "get": ["y", { | ||||
|                       "sub": ["i", "w"] | ||||
|                     }] | ||||
|                   }] | ||||
|                 }, "w"] | ||||
|               } | ||||
|             } | ||||
|           }, { | ||||
|             "assignment": { | ||||
|               "var": { | ||||
|                 "get": ["_builtin_ret", "i"] | ||||
|               }, | ||||
|               "op": ":=", | ||||
|               "expr": { | ||||
|                 "avg": { | ||||
|                   "mul": [{ | ||||
|                     "sub": [{ | ||||
|                       "x": [{ | ||||
|                         "sub": ["l", "w"] | ||||
|                       }, "l"] | ||||
|                     }, "xmeans"] | ||||
|                   }, { | ||||
|                     "sub": [{ | ||||
|                       "y": [{ | ||||
|                         "sub": ["l", "w"] | ||||
|                       }, "l"] | ||||
|                     }, "ymeans"] | ||||
|                   }] | ||||
|                 } | ||||
|               } | ||||
|             } | ||||
|           }] | ||||
|         } | ||||
|       }], | ||||
|       "ret": { | ||||
|         "null": {} | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -1,30 +1,32 @@ | ||||
| # put environment specific configuration here | ||||
| 
 | ||||
| import os | ||||
| # os.environ['CXX'] = 'C:/Program Files/LLVM/bin/clang.exe' | ||||
| 
 | ||||
| add_path_to_ldpath = True | ||||
| 
 | ||||
| os_platform = 'unkown' | ||||
| 
 | ||||
| import sys | ||||
| 
 | ||||
| if os.name == 'nt': | ||||
|     if sys.platform == 'win32': | ||||
|         os_platform = 'win' | ||||
|     elif sys.platform == 'cygwin' or sys.platform == 'msys': | ||||
|         os_platform = 'cygwin' | ||||
| elif os.name == 'posix': | ||||
|     if sys.platform == 'darwin': | ||||
|         os_platform = 'mac' | ||||
|     elif 'linux' in sys.platform: | ||||
|         os_platform = 'linux' | ||||
|     elif 'bsd' in sys.platform: | ||||
|         os_platform = 'bsd' | ||||
| 
 | ||||
| 
 | ||||
| # deal with msys dependencies: | ||||
| if os_platform == 'win': | ||||
|     os.add_dll_directory('c:/msys64/usr/bin')   | ||||
|     os.add_dll_directory(os.path.abspath('./msc-plugin')) | ||||
| # put environment specific configuration here | ||||
| 
 | ||||
| import os | ||||
| # os.environ['CXX'] = 'C:/Program Files/LLVM/bin/clang.exe' | ||||
| 
 | ||||
| add_path_to_ldpath = True | ||||
| rebuild_backend = False | ||||
| run_backend = False | ||||
| 
 | ||||
| os_platform = 'unkown' | ||||
| 
 | ||||
| import sys | ||||
| 
 | ||||
| if os.name == 'nt': | ||||
|     if sys.platform == 'win32': | ||||
|         os_platform = 'win' | ||||
|     elif sys.platform == 'cygwin' or sys.platform == 'msys': | ||||
|         os_platform = 'cygwin' | ||||
| elif os.name == 'posix': | ||||
|     if sys.platform == 'darwin': | ||||
|         os_platform = 'mac' | ||||
|     elif 'linux' in sys.platform: | ||||
|         os_platform = 'linux' | ||||
|     elif 'bsd' in sys.platform: | ||||
|         os_platform = 'bsd' | ||||
| 
 | ||||
| 
 | ||||
| # deal with msys dependencies: | ||||
| if os_platform == 'win': | ||||
|     os.add_dll_directory('c:/msys64/usr/bin')   | ||||
|     os.add_dll_directory(os.path.abspath('./msc-plugin')) | ||||
|     print("adding path") | ||||
| @ -1,15 +1,15 @@ | ||||
| ## Windows  | ||||
| - clang-msvc: | ||||
|     - "%CXX%" -D_CRT_SECURE_NO_WARNINGS -shared server/server.cpp server/winhelper.cpp server/monetdb_conn.cpp -Imonetdb/msvc -Lmonetdb/msvc -lmonetdbe.lib --std=c++2a -o server.so | ||||
|     - os.add_dll_directory(os.path.abspath('./monetdb/msvc')) | ||||
| - gcc-mingw (link w/ msvc monetdb): | ||||
|     - "%CXX%" -shared -fPIC server/server.cpp server/winhelper.cpp server/monetdb_conn.cpp -Imonetdb/msvc msc-plugin/monetdbe.dll --std=c++2a -o server.so | ||||
|     - os.add_dll_directory('c:/msys64/usr/bin') | ||||
|     - os.add_dll_directory(os.path.abspath('./monetdb/msvc')) | ||||
| - gcc-mingw (link w/ mingw monetdb, can only load under mingw python): | ||||
|     - $(CXX) server/server.cpp server/monetdb_conn.cpp -fPIC -shared $(OS_SUPPORT) --std=c++1z -O3 -march=native -o server.so -I./monetdb/msys64 -L./lib -lmonetdbe | ||||
|     - os.add_dll_directory('c:/msys64/usr/bin') | ||||
|     - os.add_dll_directory(os.path.abspath('./lib')) | ||||
| - msvc: | ||||
|     - D:\gg\vs22\MSBuild\Current\Bin\msbuild "d:\gg\AQuery++\server\server.vcxproj" /p:configuration=Release /p:platform=x64 | ||||
|     - os.add_dll_directory(os.path.abspath('./monetdb/msvc')) | ||||
| ## Windows  | ||||
| - clang-msvc: | ||||
|     - "%CXX%" -D_CRT_SECURE_NO_WARNINGS -shared server/server.cpp server/winhelper.cpp server/monetdb_conn.cpp -Imonetdb/msvc -Lmonetdb/msvc -lmonetdbe.lib --std=c++2a -o server.so | ||||
|     - os.add_dll_directory(os.path.abspath('./monetdb/msvc')) | ||||
| - gcc-mingw (link w/ msvc monetdb): | ||||
|     - "%CXX%" -shared -fPIC server/server.cpp server/winhelper.cpp server/monetdb_conn.cpp -Imonetdb/msvc msc-plugin/monetdbe.dll --std=c++2a -o server.so | ||||
|     - os.add_dll_directory('c:/msys64/usr/bin') | ||||
|     - os.add_dll_directory(os.path.abspath('./monetdb/msvc')) | ||||
| - gcc-mingw (link w/ mingw monetdb, can only load under mingw python): | ||||
|     - $(CXX) server/server.cpp server/monetdb_conn.cpp -fPIC -shared $(OS_SUPPORT) --std=c++1z -O3 -march=native -o server.so -I./monetdb/msys64 -L./lib -lmonetdbe | ||||
|     - os.add_dll_directory('c:/msys64/usr/bin') | ||||
|     - os.add_dll_directory(os.path.abspath('./lib')) | ||||
| - msvc: | ||||
|     - D:\gg\vs22\MSBuild\Current\Bin\msbuild "d:\gg\AQuery++\server\server.vcxproj" /p:configuration=Release /p:platform=x64 | ||||
|     - os.add_dll_directory(os.path.abspath('./monetdb/msvc')) | ||||
|  | ||||
| @ -1,24 +1,35 @@ | ||||
| FUNCTION covariance (x , y ) { | ||||
| xmean := avg (x) ; | ||||
| ymean := avg (y) ; | ||||
| avg (( x - xmean ) * (y - ymean )) | ||||
| } | ||||
| 
 | ||||
| FUNCTION sd ( x) { | ||||
| sqrt ( covariance (x , x) ) | ||||
| } | ||||
| 
 | ||||
| FUNCTION pairCorr (x , y ) { | ||||
| covariance (x , y ) / ( sd (x) * sd (y )) | ||||
| } | ||||
| 
 | ||||
| CREATE TABLE test1(a INT, b INT, c INT, d INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "test.csv" | ||||
| INTO TABLE test1 | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| SELECT pairCorr(c, b) * d, sum(a), b | ||||
| FROM test1 | ||||
| group by c,b,d | ||||
| FUNCTION covariance (x , y ) { | ||||
| xmean := avg (x) ; | ||||
| ymean := avg (y) ; | ||||
| avg (( x - xmean ) * (y - ymean )) | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| FUNCTION sd ( x) { | ||||
| sqrt ( covariance (x , x) ) | ||||
| } | ||||
| 
 | ||||
| AGGREGATION FUNCTION covariances(x, y, w){ | ||||
|     static xmeans := 0, ymeans := 0, cnt := 0;  | ||||
|     if (cnt < w) { xmeans += x; } | ||||
|     else {        | ||||
|         xmeans += (x - x.vec[cnt - w]) / w; | ||||
|         ymeans += (y - y.vec[cnt - w]) / w;    | ||||
|     } | ||||
|     avg (( x.vec(x.len-w, x.len) - xmean ) * (y.vec(y.len - w, y.len) - ymean )) | ||||
| } | ||||
| 
 | ||||
| FUNCTION pairCorr (x , y ) { | ||||
| covariance (x , y ) / ( sd (x) * sd (y )) | ||||
| } | ||||
| 
 | ||||
| CREATE TABLE test1(a INT, b INT, c INT, d INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "test.csv" | ||||
| INTO TABLE test1 | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| SELECT pairCorr(c, b) * d, sum(a), b | ||||
| FROM test1 | ||||
| group by c,b,d | ||||
| order by b ASC | ||||
| @ -1,34 +1,34 @@ | ||||
| FUNCTION covariance (x , y ) { | ||||
| xmean := avg (x) ; | ||||
| ymean := avg (y) ; | ||||
| avg (( x - xmean ) * (y - ymean )) | ||||
| } | ||||
| 
 | ||||
| FUNCTION sd ( x) { | ||||
| sqrt ( covariance (x , x) ) | ||||
| } | ||||
| 
 | ||||
| FUNCTION pairCorr (x , y ) { | ||||
| covariance (x , y ) / ( sd (x) * sd (y )) | ||||
| } | ||||
| 
 | ||||
| -- FUNCTION covariances (w, x , y ) { | ||||
| -- xmean := avgs (w, x) ; | ||||
| -- ymean := avgs (y) ; | ||||
| -- avg (( x - xmean ) * (y - ymean )) | ||||
| -- } | ||||
| 
 | ||||
| CREATE TABLE tt(a INT, b INT, c INT, d INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "test.csv" | ||||
| INTO TABLE tt | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| CREATE TABLE sale(Mont INT, sales INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "moving_avg.csv" | ||||
| INTO TABLE sale | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| select sd(a) + sales from tt, sale where tt.a = sale.Mont | ||||
| 
 | ||||
| FUNCTION covariance (x , y ) { | ||||
| xmean := avg (x) ; | ||||
| ymean := avg (y) ; | ||||
| avg (( x - xmean ) * (y - ymean )) | ||||
| } | ||||
| 
 | ||||
| FUNCTION sd ( x) { | ||||
| sqrt ( covariance (x , x) ) | ||||
| } | ||||
| 
 | ||||
| FUNCTION pairCorr (x , y ) { | ||||
| covariance (x , y ) / ( sd (x) * sd (y )) | ||||
| } | ||||
| 
 | ||||
| -- FUNCTION covariances (w, x , y ) { | ||||
| -- xmean := avgs (w, x) ; | ||||
| -- ymean := avgs (y) ; | ||||
| -- avg (( x - xmean ) * (y - ymean )) | ||||
| -- } | ||||
| 
 | ||||
| CREATE TABLE tt(a INT, b INT, c INT, d INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "test.csv" | ||||
| INTO TABLE tt | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| CREATE TABLE sale(Mont INT, sales INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "moving_avg.csv" | ||||
| INTO TABLE sale | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| select sd(a) + sales from tt, sale where tt.a = sale.Mont | ||||
| 
 | ||||
|  | ||||
| @ -1,98 +0,0 @@ | ||||
| # Generated by CMake | ||||
| 
 | ||||
| if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6) | ||||
|    message(FATAL_ERROR "CMake >= 2.6.0 required") | ||||
| endif() | ||||
| cmake_policy(PUSH) | ||||
| cmake_policy(VERSION 2.6...3.21) | ||||
| #---------------------------------------------------------------- | ||||
| # Generated CMake target import file. | ||||
| #---------------------------------------------------------------- | ||||
| 
 | ||||
| # Commands may need to know the format version. | ||||
| set(CMAKE_IMPORT_FILE_VERSION 1) | ||||
| 
 | ||||
| # Protect against multiple inclusion, which would fail when already imported targets are added once more. | ||||
| set(_targetsDefined) | ||||
| set(_targetsNotDefined) | ||||
| set(_expectedTargets) | ||||
| foreach(_expectedTarget MonetDB::monetdb_config_header) | ||||
|   list(APPEND _expectedTargets ${_expectedTarget}) | ||||
|   if(NOT TARGET ${_expectedTarget}) | ||||
|     list(APPEND _targetsNotDefined ${_expectedTarget}) | ||||
|   endif() | ||||
|   if(TARGET ${_expectedTarget}) | ||||
|     list(APPEND _targetsDefined ${_expectedTarget}) | ||||
|   endif() | ||||
| endforeach() | ||||
| if("${_targetsDefined}" STREQUAL "${_expectedTargets}") | ||||
|   unset(_targetsDefined) | ||||
|   unset(_targetsNotDefined) | ||||
|   unset(_expectedTargets) | ||||
|   set(CMAKE_IMPORT_FILE_VERSION) | ||||
|   cmake_policy(POP) | ||||
|   return() | ||||
| endif() | ||||
| if(NOT "${_targetsDefined}" STREQUAL "") | ||||
|   message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") | ||||
| endif() | ||||
| unset(_targetsDefined) | ||||
| unset(_targetsNotDefined) | ||||
| unset(_expectedTargets) | ||||
| 
 | ||||
| 
 | ||||
| # Compute the installation prefix relative to this file. | ||||
| get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||||
| get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) | ||||
| get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) | ||||
| get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) | ||||
| if(_IMPORT_PREFIX STREQUAL "/") | ||||
|   set(_IMPORT_PREFIX "") | ||||
| endif() | ||||
| 
 | ||||
| # Create imported target MonetDB::monetdb_config_header | ||||
| add_library(MonetDB::monetdb_config_header INTERFACE IMPORTED) | ||||
| 
 | ||||
| set_target_properties(MonetDB::monetdb_config_header PROPERTIES | ||||
|   INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/monetdb" | ||||
| ) | ||||
| 
 | ||||
| if(CMAKE_VERSION VERSION_LESS 3.0.0) | ||||
|   message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") | ||||
| endif() | ||||
| 
 | ||||
| # Load information for each installed configuration. | ||||
| get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||||
| file(GLOB CONFIG_FILES "${_DIR}/monetdb_config_headerTargets-*.cmake") | ||||
| foreach(f ${CONFIG_FILES}) | ||||
|   include(${f}) | ||||
| endforeach() | ||||
| 
 | ||||
| # Cleanup temporary variables. | ||||
| set(_IMPORT_PREFIX) | ||||
| 
 | ||||
| # Loop over all imported files and verify that they actually exist | ||||
| foreach(target ${_IMPORT_CHECK_TARGETS} ) | ||||
|   foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) | ||||
|     if(NOT EXISTS "${file}" ) | ||||
|       message(FATAL_ERROR "The imported target \"${target}\" references the file | ||||
|    \"${file}\" | ||||
| but this file does not exist.  Possible reasons include: | ||||
| * The file was deleted, renamed, or moved to another location. | ||||
| * An install or uninstall procedure did not complete successfully. | ||||
| * The installation package was faulty and contained | ||||
|    \"${CMAKE_CURRENT_LIST_FILE}\" | ||||
| but not all the files it references. | ||||
| ") | ||||
|     endif() | ||||
|   endforeach() | ||||
|   unset(_IMPORT_CHECK_FILES_FOR_${target}) | ||||
| endforeach() | ||||
| unset(_IMPORT_CHECK_TARGETS) | ||||
| 
 | ||||
| # This file does not depend on other imported targets which have | ||||
| # been exported from the same project but in a separate export set. | ||||
| 
 | ||||
| # Commands beyond this point should not need to know the version. | ||||
| set(CMAKE_IMPORT_FILE_VERSION) | ||||
| cmake_policy(POP) | ||||
| @ -0,0 +1,4 @@ | ||||
| LOAD MODULE FROM "test.so"  | ||||
| FUNCTIONS (div(a:int, b:int) -> double,  | ||||
|     mulvec(a:int, b:vecfloat) -> vecfloat | ||||
| ); | ||||
| @ -1,466 +1,466 @@ | ||||
| /*
 | ||||
|  * 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 - 2022 MonetDB B.V. | ||||
|  */ | ||||
| /* monetdb_config.h.in.  Generated from CMakeLists.txt  */ | ||||
| 
 | ||||
| #ifndef MT_SEEN_MONETDB_CONFIG_H | ||||
| #define MT_SEEN_MONETDB_CONFIG_H 1 | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #if _MSC_VER < 1900 | ||||
| #error Versions below Visual Studio 2015 are no longer supported | ||||
| #endif | ||||
| 
 | ||||
| /* Prevent pollution through excessive inclusion of include files by Windows.h. */ | ||||
| #ifndef WIN32_LEAN_AND_MEAN | ||||
| #define WIN32_LEAN_AND_MEAN 1 | ||||
| #endif | ||||
| 
 | ||||
| /* Visual Studio 8 has deprecated lots of stuff: suppress warnings */ | ||||
| #ifndef _CRT_SECURE_NO_DEPRECATE | ||||
| #define _CRT_SECURE_NO_DEPRECATE 1 | ||||
| #endif | ||||
| 
 | ||||
| #define _CRT_RAND_S				/* for Windows rand_s, before stdlib.h */ | ||||
| #define HAVE_RAND_S 1 | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(_XOPEN_SOURCE) && defined(__CYGWIN__) | ||||
| #define _XOPEN_SOURCE 700 | ||||
| #endif | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| #if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) | ||||
| /* In this case, malloc and friends are redefined in crtdbg.h to debug
 | ||||
|  * versions.  We need to include stdlib.h first or else we get | ||||
|  * conflicting declarations. */ | ||||
| #include <crtdbg.h> | ||||
| #endif | ||||
| 
 | ||||
| #define HAVE_SYS_TYPES_H 1 | ||||
| #ifdef HAVE_SYS_TYPES_H | ||||
| # include <sys/types.h> | ||||
| #endif | ||||
| 
 | ||||
| /* standard C-99 include files */ | ||||
| #include <assert.h> | ||||
| #include <errno.h> | ||||
| #include <inttypes.h> | ||||
| #include <stdarg.h> | ||||
| #include <stdbool.h> | ||||
| #include <stddef.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| /* Windows include files */ | ||||
| #include <process.h> | ||||
| #include <windows.h> | ||||
| #include <ws2tcpip.h> | ||||
| 
 | ||||
| /* indicate to sqltypes.h that windows.h has already been included and
 | ||||
|    that it doesn't have to define Windows constants */ | ||||
| #define ALREADY_HAVE_WINDOWS_TYPE 1 | ||||
| 
 | ||||
| #define NATIVE_WIN32 1 | ||||
| 
 | ||||
| #endif /* _MSC_VER */ | ||||
| 
 | ||||
| #if !defined(WIN32) && (defined(__CYGWIN__) || defined(__MINGW32__)) | ||||
| #define WIN32 1 | ||||
| #endif | ||||
| 
 | ||||
| // Section: monetdb configure defines
 | ||||
| /* #undef HAVE_DISPATCH_DISPATCH_H */ | ||||
| /* #undef HAVE_DLFCN_H */ | ||||
| #define HAVE_FCNTL_H 1 | ||||
| #define HAVE_IO_H 1 | ||||
| /* #undef HAVE_KVM_H */ | ||||
| /* #undef HAVE_LIBGEN_H */ | ||||
| /* #undef HAVE_LIBINTL_H */ | ||||
| /* #undef HAVE_MACH_MACH_INIT_H */ | ||||
| /* #undef HAVE_MACH_TASK_H */ | ||||
| /* #undef HAVE_MACH_O_DYLD_H */ | ||||
| /* #undef HAVE_NETDB_H */ | ||||
| /* #undef HAVE_NETINET_IN_H */ | ||||
| /* #undef HAVE_POLL_H */ | ||||
| /* #undef HAVE_PROCFS_H */ | ||||
| /* #undef HAVE_PWD_H */ | ||||
| /* #undef HAVE_STRINGS_H */ | ||||
| /* #undef HAVE_STROPTS_H */ | ||||
| /* #undef HAVE_SYS_FILE_H */ | ||||
| /* #undef HAVE_SYS_IOCTL_H */ | ||||
| /* #undef HAVE_SYS_SYSCTL_H */ | ||||
| /* #undef HAVE_SYS_MMAN_H */ | ||||
| /* #undef HAVE_SYS_PARAM_H */ | ||||
| /* #undef HAVE_SYS_RANDOM_H */ | ||||
| /* #undef HAVE_SYS_RESOURCE_H */ | ||||
| /* #undef HAVE_SYS_TIME_H */ | ||||
| /* #undef HAVE_SYS_TIMES_H */ | ||||
| /* #undef HAVE_SYS_UIO_H */ | ||||
| /* #undef HAVE_SYS_UN_H */ | ||||
| /* #undef HAVE_SYS_WAIT_H */ | ||||
| /* #undef HAVE_TERMIOS_H */ | ||||
| /* #undef HAVE_UNISTD_H */ | ||||
| /* #undef HAVE_UUID_UUID_H */ | ||||
| #define HAVE_WINSOCK_H 1 | ||||
| /* #undef HAVE_SEMAPHORE_H */ | ||||
| #define HAVE_GETOPT_H 1 | ||||
| 
 | ||||
| /* #undef HAVE_STDATOMIC_H */ | ||||
| 
 | ||||
| /* #undef HAVE_DIRENT_H */ | ||||
| /* #undef HAVE_SYS_SOCKET_H */ | ||||
| /* #undef HAVE_GETTIMEOFDAY */ | ||||
| #define HAVE_SYS_STAT_H 1 | ||||
| /* #undef HAVE_FDATASYNC */ | ||||
| /* #undef HAVE_ACCEPT4 */ | ||||
| /* #undef HAVE_ASCTIME_R */ | ||||
| /* #undef HAVE_CLOCK_GETTIME */ | ||||
| /* #undef HAVE_CTIME_R */ | ||||
| /* #undef HAVE_DISPATCH_SEMAPHORE_CREATE */ | ||||
| /* #undef HAVE_FALLOCATE */ | ||||
| /* #undef HAVE_FCNTL */ | ||||
| /* #undef HAVE_FORK */ | ||||
| /* #undef HAVE_FSYNC */ | ||||
| #define HAVE_FTIME 1 | ||||
| /* #undef HAVE_GETENTROPY */ | ||||
| /* #undef HAVE_GETEXECNAME */ | ||||
| /* #undef HAVE_GETLOGIN */ | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| /* #undef HAVE_GETRLIMIT */ | ||||
| /* #undef HAVE_GETTIMEOFDAY */ | ||||
| /* #undef HAVE_GETUID */ | ||||
| /* #undef HAVE_GMTIME_R */ | ||||
| /* #undef HAVE_LOCALTIME_R */ | ||||
| /* #undef HAVE_STRERROR_R */ | ||||
| /* #undef HAVE_LOCKF */ | ||||
| /* #undef HAVE_MADVISE */ | ||||
| /* #undef HAVE_MREMAP */ | ||||
| /* #undef HAVE_NANOSLEEP */ | ||||
| /* #undef HAVE_NL_LANGINFO */ | ||||
| /* #undef HAVE__NSGETEXECUTABLEPATH */ | ||||
| /* #undef HAVE_PIPE2 */ | ||||
| /* #undef HAVE_POLL */ | ||||
| /* #undef HAVE_POPEN */ | ||||
| /* #undef HAVE_POSIX_FADVISE */ | ||||
| /* #undef HAVE_POSIX_FALLOCATE */ | ||||
| /* #undef HAVE_POSIX_MADVISE */ | ||||
| #define HAVE_PUTENV 1 | ||||
| /* #undef HAVE_SETSID */ | ||||
| #define HAVE_SHUTDOWN 1 | ||||
| /* #undef HAVE_SIGACTION */ | ||||
| /* #undef HAVE_STPCPY */ | ||||
| /* #undef HAVE_STRCASESTR */ | ||||
| /* #undef HAVE_STRNCASECMP */ | ||||
| /* #undef HAVE_STRPTIME */ | ||||
| /* #undef HAVE_STRSIGNAL */ | ||||
| /* #undef HAVE_SYSCONF */ | ||||
| /* #undef HAVE_TASK_INFO */ | ||||
| /* #undef HAVE_TIMES */ | ||||
| /* #undef HAVE_UNAME */ | ||||
| /* #undef HAVE_SEMTIMEDOP */ | ||||
| /* #undef HAVE_PTHREAD_KILL */ | ||||
| /* #undef HAVE_PTHREAD_SIGMASK */ | ||||
| #define HAVE_GETOPT 1 | ||||
| 
 | ||||
| #define ICONV_CONST | ||||
| #define FLEXIBLE_ARRAY_MEMBER | ||||
| #define ENABLE_MAPI 1 | ||||
| #define HAVE_MAPI 1 | ||||
| // End Section: monetdb configure defines
 | ||||
| 
 | ||||
| // Section: monetdb macro variables
 | ||||
| #define HAVE_ICONV 1 | ||||
| /* #undef HAVE_PTHREAD_H */ | ||||
| #define HAVE_LIBPCRE 1 | ||||
| #define HAVE_LIBBZ2 1 | ||||
| /* #undef HAVE_CURL */ | ||||
| #define HAVE_LIBLZMA 1 | ||||
| #define HAVE_LIBXML 1 | ||||
| #define HAVE_LIBZ 1 | ||||
| #define HAVE_LIBLZ4 1 | ||||
| /* #undef HAVE_PROJ */ | ||||
| /* #undef HAVE_SNAPPY */ | ||||
| /* #undef HAVE_FITS */ | ||||
| /* #undef HAVE_UUID */ | ||||
| /* #undef HAVE_VALGRIND */ | ||||
| /* #undef HAVE_NETCDF */ | ||||
| /* #undef HAVE_READLINE */ | ||||
| /* #undef HAVE_LIBR */ | ||||
| #define RHOME "/registry" | ||||
| #define HAVE_GEOM 1 | ||||
| /* #undef HAVE_SHP */ | ||||
| #define HAVE_LIBPY3 1 | ||||
| 
 | ||||
| // #define SOCKET_LIBRARIES
 | ||||
| #define HAVE_GETADDRINFO 1 | ||||
| /* #undef HAVE_CUDF */ | ||||
| 
 | ||||
| #define MAPI_PORT 50000 | ||||
| #define MAPI_PORT_STR "50000" | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define DIR_SEP '\\' | ||||
| #define PATH_SEP ';' | ||||
| #define DIR_SEP_STR "\\" | ||||
| #define SO_PREFIX "" | ||||
| #else | ||||
| #define DIR_SEP '/' | ||||
| #define PATH_SEP ':' | ||||
| #define DIR_SEP_STR "/" | ||||
| /* #undef SO_PREFIX */ | ||||
| #endif | ||||
| #define SO_EXT ".dll" | ||||
| 
 | ||||
| #define BINDIR "C:/cygwin64/home/monet/x86_64/install/bin" | ||||
| #define LIBDIR "C:/cygwin64/home/monet/x86_64/install/lib" | ||||
| #define LOCALSTATEDIR "C:/cygwin64/home/monet/x86_64/install/var" | ||||
| 
 | ||||
| // End Section: monetdb macro variables
 | ||||
| 
 | ||||
| // Section: monetdb configure misc
 | ||||
| #define MONETDB_RELEASE "Jan2022-SP3" | ||||
| 
 | ||||
| #define MONETDB_VERSION "11.43.15" | ||||
| #define MONETDB_VERSION_MAJOR 11 | ||||
| #define MONETDB_VERSION_MINOR 43 | ||||
| #define MONETDB_VERSION_PATCH 15 | ||||
| 
 | ||||
| #define GDK_VERSION "25.1.0" | ||||
| #define GDK_VERSION_MAJOR 25 | ||||
| #define GDK_VERSION_MINOR 1 | ||||
| #define GDK_VERSION_PATCH 0 | ||||
| #define MAPI_VERSION "14.0.2" | ||||
| #define MAPI_VERSION_MAJOR 14 | ||||
| #define MAPI_VERSION_MINOR 0 | ||||
| #define MAPI_VERSION_PATCH 2 | ||||
| #define MONETDB5_VERSION "32.0.6" | ||||
| #define MONETDB5_VERSION_MAJOR 32 | ||||
| #define MONETDB5_VERSION_MINOR 0 | ||||
| #define MONETDB5_VERSION_PATCH 6 | ||||
| #define MONETDBE_VERSION "3.0.2" | ||||
| #define MONETDBE_VERSION_MAJOR 3 | ||||
| #define MONETDBE_VERSION_MINOR 0 | ||||
| #define MONETDBE_VERSION_PATCH 2 | ||||
| #define STREAM_VERSION "16.0.1" | ||||
| #define STREAM_VERSION_MAJOR 16 | ||||
| #define STREAM_VERSION_MINOR 0 | ||||
| #define STREAM_VERSION_PATCH 1 | ||||
| #define SQL_VERSION "12.0.5" | ||||
| #define SQL_VERSION_MAJOR 12 | ||||
| #define SQL_VERSION_MINOR 0 | ||||
| #define SQL_VERSION_PATCH 5 | ||||
| 
 | ||||
| /* Host identifier */ | ||||
| #define HOST "amd64-pc-windows-msvc" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH "SHA512" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH_TOKEN SHA512 | ||||
| 
 | ||||
| #ifndef _Noreturn | ||||
| #define _Noreturn __declspec(noreturn) | ||||
| #endif | ||||
| #ifndef __cplusplus | ||||
| /* Does your compiler support `inline' keyword? (C99 feature) */ | ||||
| #ifndef inline | ||||
| #define inline __inline | ||||
| #endif | ||||
| /* Does your compiler support `__restrict__' keyword? (C99 feature) */ | ||||
| #ifndef __restrict__ | ||||
| #define __restrict__ restrict | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #ifndef __restrict__ | ||||
| #define __restrict__ __restrict | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure misc
 | ||||
| 
 | ||||
| // Section: monetdb configure sizes
 | ||||
| #define SIZEOF_SIZE_T 8 | ||||
| 
 | ||||
| /* The size of `void *', as computed by sizeof. */ | ||||
| #define SIZEOF_VOID_P 8 | ||||
| 
 | ||||
| #define SIZEOF_CHAR 1 | ||||
| #define SIZEOF_SHORT 2 | ||||
| #define SIZEOF_INT 4 | ||||
| #define SIZEOF_LONG 4 | ||||
| #define SIZEOF_LONG_LONG 8 | ||||
| #define SIZEOF_DOUBLE 8 | ||||
| #define SIZEOF_WCHAR_T 2 | ||||
| #define HAVE_LONG_LONG 1	/* for ODBC include files */ | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #ifdef _WIN64 | ||||
| #define LENP_OR_POINTER_T SQLLEN * | ||||
| #else | ||||
| #define LENP_OR_POINTER_T SQLPOINTER | ||||
| #endif | ||||
| #else | ||||
| #define LENP_OR_POINTER_T SQLLEN * | ||||
| #endif | ||||
| #define SIZEOF_SQLWCHAR 2 | ||||
| 
 | ||||
| /* #undef WORDS_BIGENDIAN */ | ||||
| 
 | ||||
| /* Does your compiler support `ssize_t' type? (Posix type) */ | ||||
| #ifndef ssize_t | ||||
| #define ssize_t int64_t | ||||
| #endif | ||||
| 
 | ||||
| /* The size of `__int128', as computed by sizeof. */ | ||||
| /* #undef SIZEOF___INT128 */ | ||||
| 
 | ||||
| /* The size of `__int128_t', as computed by sizeof. */ | ||||
| /* #undef SIZEOF___INT128_T */ | ||||
| 
 | ||||
| /* The size of `__uint128_t', as computed by sizeof. */ | ||||
| /* #undef SIZEOF___UINT128_T */ | ||||
| 
 | ||||
| #ifdef SIZEOF___INT128 | ||||
| typedef __int128 hge; | ||||
| typedef unsigned __int128 uhge; | ||||
| #define HAVE_HGE 1 | ||||
| #define SIZEOF_HGE SIZEOF___INT128 | ||||
| #elif defined(SIZEOF___INT128_T) && defined(SIZEOF___UINT128_T) | ||||
| typedef __int128_t hge; | ||||
| typedef __uint128_t uhge; | ||||
| #define HAVE_HGE 1 | ||||
| #define SIZEOF_HGE SIZEOF___INT128_T | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure sizes
 | ||||
| 
 | ||||
| /* Does your compiler support `__attribute__' extension? */ | ||||
| #if !defined(__GNUC__) && !defined(__clang__) && !defined(__attribute__) | ||||
| #define __attribute__(a) | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(__cplusplus) || __cplusplus < 201103L | ||||
| #ifndef static_assert | ||||
| /* static_assert is a C11/C++11 feature, defined in assert.h which also exists
 | ||||
|  * in many other compilers we ignore it if the compiler doesn't support it | ||||
|  * However in C11 static_assert is a macro, while on C++11 is a keyword */ | ||||
| #define static_assert(expr, mesg)	((void) 0) | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #ifdef HAVE_STRINGS_H | ||||
| #include <strings.h>		/* strcasecmp */ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #define strdup(s)	_strdup(s) | ||||
| 
 | ||||
| #ifndef strcasecmp | ||||
| #define strcasecmp(x,y) _stricmp(x,y) | ||||
| #endif | ||||
| 
 | ||||
| /* Define to 1 if you have the `strncasecmp' function. */ | ||||
| #define HAVE_STRNCASECMP 1 | ||||
| #ifndef strncasecmp | ||||
| #define strncasecmp(x,y,z) _strnicmp(x,y,z) | ||||
| #endif | ||||
| 
 | ||||
| #include <sys/stat.h> | ||||
| #ifdef lstat | ||||
| #undef lstat | ||||
| #endif | ||||
| #define lstat _stat64 | ||||
| #ifdef stat | ||||
| #undef stat | ||||
| #endif | ||||
| #define stat _stat64 | ||||
| #ifdef fstat | ||||
| #undef fstat | ||||
| #endif | ||||
| #define fstat _fstat64 | ||||
| 
 | ||||
| static inline char * | ||||
| stpcpy(char *__restrict__ dst, const char *__restrict__ src) | ||||
| { | ||||
| 	size_t i; | ||||
| 	for (i = 0; src[i]; i++) | ||||
| 		dst[i] = src[i]; | ||||
| 	dst[i] = 0; | ||||
| 	return dst + i; | ||||
| } | ||||
| 
 | ||||
| /* Define to 1 if the system has the type `socklen_t'. */ | ||||
| #define HAVE_SOCKLEN_T 1 | ||||
| /* type used by connect */ | ||||
| #define socklen_t int | ||||
| #define strtok_r(t,d,c) strtok_s(t,d,c) | ||||
| 
 | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| 
 | ||||
| /* there is something very similar to localtime_r on Windows: */ | ||||
| #include <time.h> | ||||
| #define HAVE_LOCALTIME_R 1 | ||||
| static inline struct tm * | ||||
| localtime_r(const time_t *__restrict__ timep, struct tm *__restrict__ result) | ||||
| { | ||||
| 	return localtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| #define HAVE_GMTIME_R 1 | ||||
| static inline struct tm * | ||||
| gmtime_r(const time_t *__restrict__ timep, struct tm *__restrict__ result) | ||||
| { | ||||
| 	return gmtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| 
 | ||||
| /* Define if you have ctime_r(time_t*,char *buf,size_t s) */ | ||||
| #define HAVE_CTIME_R 1 | ||||
| #define HAVE_CTIME_R3 1 | ||||
| /* there is something very similar to ctime_r on Windows: */ | ||||
| #define ctime_r(t,b,s)  (ctime_s(b,s,t) ? NULL : (b)) | ||||
| 
 | ||||
| #endif	/* _MSC_VER */ | ||||
| 
 | ||||
| #define HAVE_SOCKLEN_T 1 | ||||
| #ifndef _MSC_VER | ||||
| #define SOCKET int | ||||
| #define closesocket close | ||||
| #endif | ||||
| 
 | ||||
| #ifndef _In_z_ | ||||
| #define _In_z_ | ||||
| #endif | ||||
| #ifndef _Printf_format_string_ | ||||
| #define _Printf_format_string_ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define _LIB_STARTUP_FUNC_(f,q) \ | ||||
|         static void f(void); \ | ||||
|         __declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \ | ||||
|         __pragma(comment(linker,"/include:" q #f "_")) \ | ||||
|         static void f(void) | ||||
| #ifdef _WIN64 | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"") | ||||
| #else | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"_") | ||||
| #endif | ||||
| #else | ||||
| #define LIB_STARTUP_FUNC(f) \ | ||||
|         static void f(void) __attribute__((__constructor__)); \ | ||||
|         static void f(void) | ||||
| #endif | ||||
| 
 | ||||
| #endif /* MT_SEEN_MONETDB_CONFIG_H */ | ||||
| /*
 | ||||
|  * 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 - 2022 MonetDB B.V. | ||||
|  */ | ||||
| /* monetdb_config.h.in.  Generated from CMakeLists.txt  */ | ||||
| 
 | ||||
| #ifndef MT_SEEN_MONETDB_CONFIG_H | ||||
| #define MT_SEEN_MONETDB_CONFIG_H 1 | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #if _MSC_VER < 1900 | ||||
| #error Versions below Visual Studio 2015 are no longer supported | ||||
| #endif | ||||
| 
 | ||||
| /* Prevent pollution through excessive inclusion of include files by Windows.h. */ | ||||
| #ifndef WIN32_LEAN_AND_MEAN | ||||
| #define WIN32_LEAN_AND_MEAN 1 | ||||
| #endif | ||||
| 
 | ||||
| /* Visual Studio 8 has deprecated lots of stuff: suppress warnings */ | ||||
| #ifndef _CRT_SECURE_NO_DEPRECATE | ||||
| #define _CRT_SECURE_NO_DEPRECATE 1 | ||||
| #endif | ||||
| 
 | ||||
| #define _CRT_RAND_S				/* for Windows rand_s, before stdlib.h */ | ||||
| #define HAVE_RAND_S 1 | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(_XOPEN_SOURCE) && defined(__CYGWIN__) | ||||
| #define _XOPEN_SOURCE 700 | ||||
| #endif | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| #if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) | ||||
| /* In this case, malloc and friends are redefined in crtdbg.h to debug
 | ||||
|  * versions.  We need to include stdlib.h first or else we get | ||||
|  * conflicting declarations. */ | ||||
| #include <crtdbg.h> | ||||
| #endif | ||||
| 
 | ||||
| #define HAVE_SYS_TYPES_H 1 | ||||
| #ifdef HAVE_SYS_TYPES_H | ||||
| # include <sys/types.h> | ||||
| #endif | ||||
| 
 | ||||
| /* standard C-99 include files */ | ||||
| #include <assert.h> | ||||
| #include <errno.h> | ||||
| #include <inttypes.h> | ||||
| #include <stdarg.h> | ||||
| #include <stdbool.h> | ||||
| #include <stddef.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| /* Windows include files */ | ||||
| #include <process.h> | ||||
| #include <windows.h> | ||||
| #include <ws2tcpip.h> | ||||
| 
 | ||||
| /* indicate to sqltypes.h that windows.h has already been included and
 | ||||
|    that it doesn't have to define Windows constants */ | ||||
| #define ALREADY_HAVE_WINDOWS_TYPE 1 | ||||
| 
 | ||||
| #define NATIVE_WIN32 1 | ||||
| 
 | ||||
| #endif /* _MSC_VER */ | ||||
| 
 | ||||
| #if !defined(WIN32) && (defined(__CYGWIN__) || defined(__MINGW32__)) | ||||
| #define WIN32 1 | ||||
| #endif | ||||
| 
 | ||||
| // Section: monetdb configure defines
 | ||||
| /* #undef HAVE_DISPATCH_DISPATCH_H */ | ||||
| /* #undef HAVE_DLFCN_H */ | ||||
| #define HAVE_FCNTL_H 1 | ||||
| #define HAVE_IO_H 1 | ||||
| /* #undef HAVE_KVM_H */ | ||||
| /* #undef HAVE_LIBGEN_H */ | ||||
| /* #undef HAVE_LIBINTL_H */ | ||||
| /* #undef HAVE_MACH_MACH_INIT_H */ | ||||
| /* #undef HAVE_MACH_TASK_H */ | ||||
| /* #undef HAVE_MACH_O_DYLD_H */ | ||||
| /* #undef HAVE_NETDB_H */ | ||||
| /* #undef HAVE_NETINET_IN_H */ | ||||
| /* #undef HAVE_POLL_H */ | ||||
| /* #undef HAVE_PROCFS_H */ | ||||
| /* #undef HAVE_PWD_H */ | ||||
| /* #undef HAVE_STRINGS_H */ | ||||
| /* #undef HAVE_STROPTS_H */ | ||||
| /* #undef HAVE_SYS_FILE_H */ | ||||
| /* #undef HAVE_SYS_IOCTL_H */ | ||||
| /* #undef HAVE_SYS_SYSCTL_H */ | ||||
| /* #undef HAVE_SYS_MMAN_H */ | ||||
| /* #undef HAVE_SYS_PARAM_H */ | ||||
| /* #undef HAVE_SYS_RANDOM_H */ | ||||
| /* #undef HAVE_SYS_RESOURCE_H */ | ||||
| /* #undef HAVE_SYS_TIME_H */ | ||||
| /* #undef HAVE_SYS_TIMES_H */ | ||||
| /* #undef HAVE_SYS_UIO_H */ | ||||
| /* #undef HAVE_SYS_UN_H */ | ||||
| /* #undef HAVE_SYS_WAIT_H */ | ||||
| /* #undef HAVE_TERMIOS_H */ | ||||
| /* #undef HAVE_UNISTD_H */ | ||||
| /* #undef HAVE_UUID_UUID_H */ | ||||
| #define HAVE_WINSOCK_H 1 | ||||
| /* #undef HAVE_SEMAPHORE_H */ | ||||
| #define HAVE_GETOPT_H 1 | ||||
| 
 | ||||
| /* #undef HAVE_STDATOMIC_H */ | ||||
| 
 | ||||
| /* #undef HAVE_DIRENT_H */ | ||||
| /* #undef HAVE_SYS_SOCKET_H */ | ||||
| /* #undef HAVE_GETTIMEOFDAY */ | ||||
| #define HAVE_SYS_STAT_H 1 | ||||
| /* #undef HAVE_FDATASYNC */ | ||||
| /* #undef HAVE_ACCEPT4 */ | ||||
| /* #undef HAVE_ASCTIME_R */ | ||||
| /* #undef HAVE_CLOCK_GETTIME */ | ||||
| /* #undef HAVE_CTIME_R */ | ||||
| /* #undef HAVE_DISPATCH_SEMAPHORE_CREATE */ | ||||
| /* #undef HAVE_FALLOCATE */ | ||||
| /* #undef HAVE_FCNTL */ | ||||
| /* #undef HAVE_FORK */ | ||||
| /* #undef HAVE_FSYNC */ | ||||
| #define HAVE_FTIME 1 | ||||
| /* #undef HAVE_GETENTROPY */ | ||||
| /* #undef HAVE_GETEXECNAME */ | ||||
| /* #undef HAVE_GETLOGIN */ | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| /* #undef HAVE_GETRLIMIT */ | ||||
| /* #undef HAVE_GETTIMEOFDAY */ | ||||
| /* #undef HAVE_GETUID */ | ||||
| /* #undef HAVE_GMTIME_R */ | ||||
| /* #undef HAVE_LOCALTIME_R */ | ||||
| /* #undef HAVE_STRERROR_R */ | ||||
| /* #undef HAVE_LOCKF */ | ||||
| /* #undef HAVE_MADVISE */ | ||||
| /* #undef HAVE_MREMAP */ | ||||
| /* #undef HAVE_NANOSLEEP */ | ||||
| /* #undef HAVE_NL_LANGINFO */ | ||||
| /* #undef HAVE__NSGETEXECUTABLEPATH */ | ||||
| /* #undef HAVE_PIPE2 */ | ||||
| /* #undef HAVE_POLL */ | ||||
| /* #undef HAVE_POPEN */ | ||||
| /* #undef HAVE_POSIX_FADVISE */ | ||||
| /* #undef HAVE_POSIX_FALLOCATE */ | ||||
| /* #undef HAVE_POSIX_MADVISE */ | ||||
| #define HAVE_PUTENV 1 | ||||
| /* #undef HAVE_SETSID */ | ||||
| #define HAVE_SHUTDOWN 1 | ||||
| /* #undef HAVE_SIGACTION */ | ||||
| /* #undef HAVE_STPCPY */ | ||||
| /* #undef HAVE_STRCASESTR */ | ||||
| /* #undef HAVE_STRNCASECMP */ | ||||
| /* #undef HAVE_STRPTIME */ | ||||
| /* #undef HAVE_STRSIGNAL */ | ||||
| /* #undef HAVE_SYSCONF */ | ||||
| /* #undef HAVE_TASK_INFO */ | ||||
| /* #undef HAVE_TIMES */ | ||||
| /* #undef HAVE_UNAME */ | ||||
| /* #undef HAVE_SEMTIMEDOP */ | ||||
| /* #undef HAVE_PTHREAD_KILL */ | ||||
| /* #undef HAVE_PTHREAD_SIGMASK */ | ||||
| #define HAVE_GETOPT 1 | ||||
| 
 | ||||
| #define ICONV_CONST | ||||
| #define FLEXIBLE_ARRAY_MEMBER | ||||
| #define ENABLE_MAPI 1 | ||||
| #define HAVE_MAPI 1 | ||||
| // End Section: monetdb configure defines
 | ||||
| 
 | ||||
| // Section: monetdb macro variables
 | ||||
| #define HAVE_ICONV 1 | ||||
| /* #undef HAVE_PTHREAD_H */ | ||||
| #define HAVE_LIBPCRE 1 | ||||
| #define HAVE_LIBBZ2 1 | ||||
| /* #undef HAVE_CURL */ | ||||
| #define HAVE_LIBLZMA 1 | ||||
| #define HAVE_LIBXML 1 | ||||
| #define HAVE_LIBZ 1 | ||||
| #define HAVE_LIBLZ4 1 | ||||
| /* #undef HAVE_PROJ */ | ||||
| /* #undef HAVE_SNAPPY */ | ||||
| /* #undef HAVE_FITS */ | ||||
| /* #undef HAVE_UUID */ | ||||
| /* #undef HAVE_VALGRIND */ | ||||
| /* #undef HAVE_NETCDF */ | ||||
| /* #undef HAVE_READLINE */ | ||||
| /* #undef HAVE_LIBR */ | ||||
| #define RHOME "/registry" | ||||
| #define HAVE_GEOM 1 | ||||
| /* #undef HAVE_SHP */ | ||||
| #define HAVE_LIBPY3 1 | ||||
| 
 | ||||
| // #define SOCKET_LIBRARIES
 | ||||
| #define HAVE_GETADDRINFO 1 | ||||
| /* #undef HAVE_CUDF */ | ||||
| 
 | ||||
| #define MAPI_PORT 50000 | ||||
| #define MAPI_PORT_STR "50000" | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define DIR_SEP '\\' | ||||
| #define PATH_SEP ';' | ||||
| #define DIR_SEP_STR "\\" | ||||
| #define SO_PREFIX "" | ||||
| #else | ||||
| #define DIR_SEP '/' | ||||
| #define PATH_SEP ':' | ||||
| #define DIR_SEP_STR "/" | ||||
| /* #undef SO_PREFIX */ | ||||
| #endif | ||||
| #define SO_EXT ".dll" | ||||
| 
 | ||||
| #define BINDIR "C:/cygwin64/home/monet/x86_64/install/bin" | ||||
| #define LIBDIR "C:/cygwin64/home/monet/x86_64/install/lib" | ||||
| #define LOCALSTATEDIR "C:/cygwin64/home/monet/x86_64/install/var" | ||||
| 
 | ||||
| // End Section: monetdb macro variables
 | ||||
| 
 | ||||
| // Section: monetdb configure misc
 | ||||
| #define MONETDB_RELEASE "Jan2022-SP3" | ||||
| 
 | ||||
| #define MONETDB_VERSION "11.43.15" | ||||
| #define MONETDB_VERSION_MAJOR 11 | ||||
| #define MONETDB_VERSION_MINOR 43 | ||||
| #define MONETDB_VERSION_PATCH 15 | ||||
| 
 | ||||
| #define GDK_VERSION "25.1.0" | ||||
| #define GDK_VERSION_MAJOR 25 | ||||
| #define GDK_VERSION_MINOR 1 | ||||
| #define GDK_VERSION_PATCH 0 | ||||
| #define MAPI_VERSION "14.0.2" | ||||
| #define MAPI_VERSION_MAJOR 14 | ||||
| #define MAPI_VERSION_MINOR 0 | ||||
| #define MAPI_VERSION_PATCH 2 | ||||
| #define MONETDB5_VERSION "32.0.6" | ||||
| #define MONETDB5_VERSION_MAJOR 32 | ||||
| #define MONETDB5_VERSION_MINOR 0 | ||||
| #define MONETDB5_VERSION_PATCH 6 | ||||
| #define MONETDBE_VERSION "3.0.2" | ||||
| #define MONETDBE_VERSION_MAJOR 3 | ||||
| #define MONETDBE_VERSION_MINOR 0 | ||||
| #define MONETDBE_VERSION_PATCH 2 | ||||
| #define STREAM_VERSION "16.0.1" | ||||
| #define STREAM_VERSION_MAJOR 16 | ||||
| #define STREAM_VERSION_MINOR 0 | ||||
| #define STREAM_VERSION_PATCH 1 | ||||
| #define SQL_VERSION "12.0.5" | ||||
| #define SQL_VERSION_MAJOR 12 | ||||
| #define SQL_VERSION_MINOR 0 | ||||
| #define SQL_VERSION_PATCH 5 | ||||
| 
 | ||||
| /* Host identifier */ | ||||
| #define HOST "amd64-pc-windows-msvc" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH "SHA512" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH_TOKEN SHA512 | ||||
| 
 | ||||
| #ifndef _Noreturn | ||||
| #define _Noreturn __declspec(noreturn) | ||||
| #endif | ||||
| #ifndef __cplusplus | ||||
| /* Does your compiler support `inline' keyword? (C99 feature) */ | ||||
| #ifndef inline | ||||
| #define inline __inline | ||||
| #endif | ||||
| /* Does your compiler support `__restrict__' keyword? (C99 feature) */ | ||||
| #ifndef __restrict__ | ||||
| #define __restrict__ restrict | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #ifndef __restrict__ | ||||
| #define __restrict__ __restrict | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure misc
 | ||||
| 
 | ||||
| // Section: monetdb configure sizes
 | ||||
| #define SIZEOF_SIZE_T 8 | ||||
| 
 | ||||
| /* The size of `void *', as computed by sizeof. */ | ||||
| #define SIZEOF_VOID_P 8 | ||||
| 
 | ||||
| #define SIZEOF_CHAR 1 | ||||
| #define SIZEOF_SHORT 2 | ||||
| #define SIZEOF_INT 4 | ||||
| #define SIZEOF_LONG 4 | ||||
| #define SIZEOF_LONG_LONG 8 | ||||
| #define SIZEOF_DOUBLE 8 | ||||
| #define SIZEOF_WCHAR_T 2 | ||||
| #define HAVE_LONG_LONG 1	/* for ODBC include files */ | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #ifdef _WIN64 | ||||
| #define LENP_OR_POINTER_T SQLLEN * | ||||
| #else | ||||
| #define LENP_OR_POINTER_T SQLPOINTER | ||||
| #endif | ||||
| #else | ||||
| #define LENP_OR_POINTER_T SQLLEN * | ||||
| #endif | ||||
| #define SIZEOF_SQLWCHAR 2 | ||||
| 
 | ||||
| /* #undef WORDS_BIGENDIAN */ | ||||
| 
 | ||||
| /* Does your compiler support `ssize_t' type? (Posix type) */ | ||||
| #ifndef ssize_t | ||||
| #define ssize_t int64_t | ||||
| #endif | ||||
| 
 | ||||
| /* The size of `__int128', as computed by sizeof. */ | ||||
| /* #undef SIZEOF___INT128 */ | ||||
| 
 | ||||
| /* The size of `__int128_t', as computed by sizeof. */ | ||||
| /* #undef SIZEOF___INT128_T */ | ||||
| 
 | ||||
| /* The size of `__uint128_t', as computed by sizeof. */ | ||||
| /* #undef SIZEOF___UINT128_T */ | ||||
| 
 | ||||
| #ifdef SIZEOF___INT128 | ||||
| typedef __int128 hge; | ||||
| typedef unsigned __int128 uhge; | ||||
| #define HAVE_HGE 1 | ||||
| #define SIZEOF_HGE SIZEOF___INT128 | ||||
| #elif defined(SIZEOF___INT128_T) && defined(SIZEOF___UINT128_T) | ||||
| typedef __int128_t hge; | ||||
| typedef __uint128_t uhge; | ||||
| #define HAVE_HGE 1 | ||||
| #define SIZEOF_HGE SIZEOF___INT128_T | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure sizes
 | ||||
| 
 | ||||
| /* Does your compiler support `__attribute__' extension? */ | ||||
| #if !defined(__GNUC__) && !defined(__clang__) && !defined(__attribute__) | ||||
| #define __attribute__(a) | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(__cplusplus) || __cplusplus < 201103L | ||||
| #ifndef static_assert | ||||
| /* static_assert is a C11/C++11 feature, defined in assert.h which also exists
 | ||||
|  * in many other compilers we ignore it if the compiler doesn't support it | ||||
|  * However in C11 static_assert is a macro, while on C++11 is a keyword */ | ||||
| #define static_assert(expr, mesg)	((void) 0) | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #ifdef HAVE_STRINGS_H | ||||
| #include <strings.h>		/* strcasecmp */ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #define strdup(s)	_strdup(s) | ||||
| 
 | ||||
| #ifndef strcasecmp | ||||
| #define strcasecmp(x,y) _stricmp(x,y) | ||||
| #endif | ||||
| 
 | ||||
| /* Define to 1 if you have the `strncasecmp' function. */ | ||||
| #define HAVE_STRNCASECMP 1 | ||||
| #ifndef strncasecmp | ||||
| #define strncasecmp(x,y,z) _strnicmp(x,y,z) | ||||
| #endif | ||||
| 
 | ||||
| #include <sys/stat.h> | ||||
| #ifdef lstat | ||||
| #undef lstat | ||||
| #endif | ||||
| #define lstat _stat64 | ||||
| #ifdef stat | ||||
| #undef stat | ||||
| #endif | ||||
| #define stat _stat64 | ||||
| #ifdef fstat | ||||
| #undef fstat | ||||
| #endif | ||||
| #define fstat _fstat64 | ||||
| 
 | ||||
| static inline char * | ||||
| stpcpy(char *__restrict__ dst, const char *__restrict__ src) | ||||
| { | ||||
| 	size_t i; | ||||
| 	for (i = 0; src[i]; i++) | ||||
| 		dst[i] = src[i]; | ||||
| 	dst[i] = 0; | ||||
| 	return dst + i; | ||||
| } | ||||
| 
 | ||||
| /* Define to 1 if the system has the type `socklen_t'. */ | ||||
| #define HAVE_SOCKLEN_T 1 | ||||
| /* type used by connect */ | ||||
| #define socklen_t int | ||||
| #define strtok_r(t,d,c) strtok_s(t,d,c) | ||||
| 
 | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| 
 | ||||
| /* there is something very similar to localtime_r on Windows: */ | ||||
| #include <time.h> | ||||
| #define HAVE_LOCALTIME_R 1 | ||||
| static inline struct tm * | ||||
| localtime_r(const time_t *__restrict__ timep, struct tm *__restrict__ result) | ||||
| { | ||||
| 	return localtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| #define HAVE_GMTIME_R 1 | ||||
| static inline struct tm * | ||||
| gmtime_r(const time_t *__restrict__ timep, struct tm *__restrict__ result) | ||||
| { | ||||
| 	return gmtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| 
 | ||||
| /* Define if you have ctime_r(time_t*,char *buf,size_t s) */ | ||||
| #define HAVE_CTIME_R 1 | ||||
| #define HAVE_CTIME_R3 1 | ||||
| /* there is something very similar to ctime_r on Windows: */ | ||||
| #define ctime_r(t,b,s)  (ctime_s(b,s,t) ? NULL : (b)) | ||||
| 
 | ||||
| #endif	/* _MSC_VER */ | ||||
| 
 | ||||
| #define HAVE_SOCKLEN_T 1 | ||||
| #ifndef _MSC_VER | ||||
| #define SOCKET int | ||||
| #define closesocket close | ||||
| #endif | ||||
| 
 | ||||
| #ifndef _In_z_ | ||||
| #define _In_z_ | ||||
| #endif | ||||
| #ifndef _Printf_format_string_ | ||||
| #define _Printf_format_string_ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define _LIB_STARTUP_FUNC_(f,q) \ | ||||
|         static void f(void); \ | ||||
|         __declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \ | ||||
|         __pragma(comment(linker,"/include:" q #f "_")) \ | ||||
|         static void f(void) | ||||
| #ifdef _WIN64 | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"") | ||||
| #else | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"_") | ||||
| #endif | ||||
| #else | ||||
| #define LIB_STARTUP_FUNC(f) \ | ||||
|         static void f(void) __attribute__((__constructor__)); \ | ||||
|         static void f(void) | ||||
| #endif | ||||
| 
 | ||||
| #endif /* MT_SEEN_MONETDB_CONFIG_H */ | ||||
|  | ||||
| @ -1,473 +1,473 @@ | ||||
| /*
 | ||||
|  * 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 - 2022 MonetDB B.V. | ||||
|  */ | ||||
| /* monetdb_config.h.in.  Generated from CMakeLists.txt  */ | ||||
| 
 | ||||
| #ifndef MT_SEEN_MONETDB_CONFIG_H | ||||
| #define MT_SEEN_MONETDB_CONFIG_H 1 | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #if _MSC_VER < 1900 | ||||
| #error Versions below Visual Studio 2015 are no longer supported | ||||
| #endif | ||||
| 
 | ||||
| /* Prevent pollution through excessive inclusion of include files by Windows.h. */ | ||||
| #ifndef WIN32_LEAN_AND_MEAN | ||||
| #define WIN32_LEAN_AND_MEAN 1 | ||||
| #endif | ||||
| 
 | ||||
| /* Visual Studio 8 has deprecated lots of stuff: suppress warnings */ | ||||
| #ifndef _CRT_SECURE_NO_DEPRECATE | ||||
| #define _CRT_SECURE_NO_DEPRECATE 1 | ||||
| #endif | ||||
| 
 | ||||
| #define _CRT_RAND_S				/* for Windows rand_s, before stdlib.h */ | ||||
| #define HAVE_RAND_S 1 | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(_XOPEN_SOURCE) && defined(__CYGWIN__) | ||||
| #define _XOPEN_SOURCE 700 | ||||
| #endif | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| #if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) | ||||
| /* In this case, malloc and friends are redefined in crtdbg.h to debug
 | ||||
|  * versions.  We need to include stdlib.h first or else we get | ||||
|  * conflicting declarations. */ | ||||
| #include <crtdbg.h> | ||||
| #endif | ||||
| 
 | ||||
| #define HAVE_SYS_TYPES_H 1 | ||||
| #ifdef HAVE_SYS_TYPES_H | ||||
| # include <sys/types.h> | ||||
| #endif | ||||
| 
 | ||||
| /* standard C-99 include files */ | ||||
| #include <assert.h> | ||||
| #include <errno.h> | ||||
| #include <inttypes.h> | ||||
| #include <stdarg.h> | ||||
| #include <stdbool.h> | ||||
| #include <stddef.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| /* Windows include files */ | ||||
| #include <process.h> | ||||
| #include <windows.h> | ||||
| #include <ws2tcpip.h> | ||||
| 
 | ||||
| /* indicate to sqltypes.h that windows.h has already been included and
 | ||||
|    that it doesn't have to define Windows constants */ | ||||
| #define ALREADY_HAVE_WINDOWS_TYPE 1 | ||||
| 
 | ||||
| #define NATIVE_WIN32 1 | ||||
| 
 | ||||
| #endif /* _MSC_VER */ | ||||
| 
 | ||||
| #if !defined(WIN32) && (defined(__CYGWIN__)||defined(__MINGW32__)) | ||||
| #define WIN32 1 | ||||
| #endif | ||||
| 
 | ||||
| // Section: monetdb configure defines
 | ||||
| /* #undef HAVE_DISPATCH_DISPATCH_H */ | ||||
| #define HAVE_DLFCN_H 1 | ||||
| #define HAVE_FCNTL_H 1 | ||||
| #define HAVE_IO_H 1 | ||||
| /* #undef HAVE_KVM_H */ | ||||
| #define HAVE_LIBGEN_H 1 | ||||
| /* #undef HAVE_LIBINTL_H */ | ||||
| /* #undef HAVE_MACH_MACH_INIT_H */ | ||||
| /* #undef HAVE_MACH_TASK_H */ | ||||
| /* #undef HAVE_MACH_O_DYLD_H */ | ||||
| #define HAVE_NETDB_H 1 | ||||
| #define HAVE_NETINET_IN_H 1 | ||||
| #define HAVE_POLL_H 1 | ||||
| /* #undef HAVE_PROCFS_H */ | ||||
| #define HAVE_PWD_H 1 | ||||
| #define HAVE_STRINGS_H 1 | ||||
| /* #undef HAVE_STROPTS_H */ | ||||
| #define HAVE_SYS_FILE_H 1 | ||||
| #define HAVE_SYS_IOCTL_H 1 | ||||
| /* #undef HAVE_SYS_SYSCTL_H */ | ||||
| #define HAVE_SYS_MMAN_H 1 | ||||
| #define HAVE_SYS_PARAM_H 1 | ||||
| #define HAVE_SYS_RANDOM_H 1 | ||||
| #define HAVE_SYS_RESOURCE_H 1 | ||||
| #define HAVE_SYS_TIME_H 1 | ||||
| #define HAVE_SYS_TIMES_H 1 | ||||
| #define HAVE_SYS_UIO_H 1 | ||||
| #define HAVE_SYS_UN_H 1 | ||||
| #define HAVE_SYS_WAIT_H 1 | ||||
| #define HAVE_TERMIOS_H 1 | ||||
| #define HAVE_UNISTD_H 1 | ||||
| #define HAVE_WINSOCK_H 1 | ||||
| #define HAVE_SEMAPHORE_H 1 | ||||
| #define HAVE_GETOPT_H 1 | ||||
| 
 | ||||
| #define HAVE_STDATOMIC_H 1 | ||||
| 
 | ||||
| #define HAVE_DIRENT_H 1 | ||||
| #define HAVE_SYS_SOCKET_H 1 | ||||
| #define HAVE_GETTIMEOFDAY 1 | ||||
| #define HAVE_SYS_STAT_H 1 | ||||
| #define HAVE_FDATASYNC 1 | ||||
| #define HAVE_ACCEPT4 1 | ||||
| #define HAVE_ASCTIME_R 1 | ||||
| #define HAVE_CLOCK_GETTIME 1 | ||||
| #define HAVE_CTIME_R 1 | ||||
| /* #undef HAVE_DISPATCH_SEMAPHORE_CREATE */ | ||||
| /* #undef HAVE_FALLOCATE */ | ||||
| #define HAVE_FCNTL 1 | ||||
| #define HAVE_FORK 1 | ||||
| #define HAVE_FSYNC 1 | ||||
| #define HAVE_FTIME 1 | ||||
| #define HAVE_GETENTROPY 1 | ||||
| /* #undef HAVE_GETEXECNAME */ | ||||
| #define HAVE_GETLOGIN 1 | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| #define HAVE_GETRLIMIT 1 | ||||
| #define HAVE_GETTIMEOFDAY 1 | ||||
| #define HAVE_GETUID 1 | ||||
| #define HAVE_GMTIME_R 1 | ||||
| #define HAVE_LOCALTIME_R 1 | ||||
| #define HAVE_STRERROR_R 1 | ||||
| #define HAVE_LOCKF 1 | ||||
| #define HAVE_MADVISE  1 | ||||
| /* #undef HAVE_MREMAP */ | ||||
| #define HAVE_NANOSLEEP  1 | ||||
| #define HAVE_NL_LANGINFO  1 | ||||
| /* #undef HAVE__NSGETEXECUTABLEPATH */ | ||||
| /* #undef HAVE_PIPE2 */ | ||||
| #define HAVE_POLL  1 | ||||
| #define HAVE_POPEN 1 | ||||
| #define HAVE_POSIX_FADVISE 1 | ||||
| #define HAVE_POSIX_FALLOCATE 1 | ||||
| #define HAVE_POSIX_MADVISE 1 | ||||
| #define HAVE_PUTENV 1 | ||||
| #define HAVE_SETSID 1 | ||||
| #define HAVE_SHUTDOWN 1 | ||||
| #define HAVE_SIGACTION 1 | ||||
| #define HAVE_STPCPY 1 | ||||
| #define HAVE_STRCASESTR 1 | ||||
| #define HAVE_STRNCASECMP 1 | ||||
| #define HAVE_STRPTIME 1 | ||||
| #define HAVE_STRSIGNAL 1 | ||||
| #define HAVE_SYSCONF 1 | ||||
| /* #undef HAVE_TASK_INFO */ | ||||
| #define HAVE_TIMES 1 | ||||
| #define HAVE_UNAME 1 | ||||
| /* #undef HAVE_SEMTIMEDOP */ | ||||
| #define HAVE_PTHREAD_KILL 1 | ||||
| #define HAVE_PTHREAD_SIGMASK 1 | ||||
| #define HAVE_GETOPT 1 | ||||
| 
 | ||||
| #define ICONV_CONST | ||||
| #define FLEXIBLE_ARRAY_MEMBER | ||||
| #define ENABLE_MAPI 1 | ||||
| #define HAVE_MAPI 1 | ||||
| // End Section: monetdb configure defines
 | ||||
| 
 | ||||
| // Section: monetdb macro variables
 | ||||
| /* #undef HAVE_ICONV */ | ||||
| #define HAVE_PTHREAD_H 1 | ||||
| /* #undef HAVE_LIBPCRE */ | ||||
| /* #undef HAVE_LIBBZ2 */ | ||||
| /* #undef HAVE_CURL */ | ||||
| /* #undef HAVE_LIBLZMA */ | ||||
| /* #undef HAVE_LIBXML */ | ||||
| /* #undef HAVE_LIBZ */ | ||||
| /* #undef HAVE_LIBLZ4 */ | ||||
| /* #undef HAVE_PROJ */ | ||||
| /* #undef HAVE_SNAPPY */ | ||||
| /* #undef HAVE_FITS */ | ||||
| /* #undef HAVE_VALGRIND */ | ||||
| /* #undef HAVE_NETCDF */ | ||||
| /* #undef HAVE_READLINE */ | ||||
| /* #undef HAVE_LIBR */ | ||||
| #define RHOME "/registry" | ||||
| /* #undef HAVE_GEOM */ | ||||
| /* #undef HAVE_SHP */ | ||||
| /* #undef HAVE_LIBPY3 */ | ||||
| 
 | ||||
| // #define SOCKET_LIBRARIES
 | ||||
| #define HAVE_GETADDRINFO 1 | ||||
| /* #undef HAVE_CUDF */ | ||||
| 
 | ||||
| #define MAPI_PORT 50000 | ||||
| #define MAPI_PORT_STR "50000" | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define DIR_SEP '\\' | ||||
| #define PATH_SEP ';' | ||||
| #define DIR_SEP_STR "\\" | ||||
| #define SO_PREFIX "" | ||||
| #else | ||||
| #define DIR_SEP '/' | ||||
| #define PATH_SEP ':' | ||||
| #define DIR_SEP_STR "/" | ||||
| #define SO_PREFIX "lib" | ||||
| #endif | ||||
| #define SO_EXT ".dll" | ||||
| 
 | ||||
| #define BINDIR "C:/Program Files (x86)/MonetDB/bin" | ||||
| #define LIBDIR "C:/Program Files (x86)/MonetDB/lib" | ||||
| #define LOCALSTATEDIR "C:/Program Files (x86)/MonetDB/var" | ||||
| 
 | ||||
| // End Section: monetdb macro variables
 | ||||
| 
 | ||||
| // Section: monetdb configure misc
 | ||||
| #define MONETDB_RELEASE "unreleased" | ||||
| 
 | ||||
| #define MONETDB_VERSION "11.44.0" | ||||
| #define MONETDB_VERSION_MAJOR 11 | ||||
| #define MONETDB_VERSION_MINOR 44 | ||||
| #define MONETDB_VERSION_PATCH 0 | ||||
| 
 | ||||
| #define GDK_VERSION "25.1.0" | ||||
| #define GDK_VERSION_MAJOR 25 | ||||
| #define GDK_VERSION_MINOR 1 | ||||
| #define GDK_VERSION_PATCH 0 | ||||
| #define MAPI_VERSION "14.0.2" | ||||
| #define MAPI_VERSION_MAJOR 14 | ||||
| #define MAPI_VERSION_MINOR 0 | ||||
| #define MAPI_VERSION_PATCH 2 | ||||
| #define MONETDB5_VERSION "32.0.6" | ||||
| #define MONETDB5_VERSION_MAJOR 32 | ||||
| #define MONETDB5_VERSION_MINOR 0 | ||||
| #define MONETDB5_VERSION_PATCH 6 | ||||
| #define MONETDBE_VERSION "3.0.2" | ||||
| #define MONETDBE_VERSION_MAJOR 3 | ||||
| #define MONETDBE_VERSION_MINOR 0 | ||||
| #define MONETDBE_VERSION_PATCH 2 | ||||
| #define STREAM_VERSION "16.0.1" | ||||
| #define STREAM_VERSION_MAJOR 16 | ||||
| #define STREAM_VERSION_MINOR 0 | ||||
| #define STREAM_VERSION_PATCH 1 | ||||
| #define SQL_VERSION "12.0.5" | ||||
| #define SQL_VERSION_MAJOR 12 | ||||
| #define SQL_VERSION_MINOR 0 | ||||
| #define SQL_VERSION_PATCH 5 | ||||
| 
 | ||||
| /* Host identifier */ | ||||
| #define HOST "amd64-pc-windows-gnu" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH "SHA512" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH_TOKEN SHA512 | ||||
| 
 | ||||
| #ifndef _Noreturn | ||||
| #ifdef __cplusplus | ||||
| #define _Noreturn | ||||
| #else | ||||
| /* #undef _Noreturn */ | ||||
| #endif | ||||
| #endif | ||||
| /* Does your compiler support `inline' keyword? (C99 feature) */ | ||||
| #ifndef inline | ||||
| #ifdef __cplusplus | ||||
| #define inline | ||||
| #else | ||||
| /* #undef inline */ | ||||
| #endif | ||||
| #endif | ||||
| /* Does your compiler support `restrict' keyword? (C99 feature) */ | ||||
| #ifndef restrict | ||||
| #ifdef __cplusplus | ||||
| #define restrict | ||||
| #else | ||||
| /* #undef restrict */ | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure misc
 | ||||
| 
 | ||||
| // Section: monetdb configure sizes
 | ||||
| #define SIZEOF_SIZE_T 8 | ||||
| 
 | ||||
| /* The size of `void *', as computed by sizeof. */ | ||||
| #define SIZEOF_VOID_P 8 | ||||
| 
 | ||||
| #define SIZEOF_CHAR 1 | ||||
| #define SIZEOF_SHORT 2 | ||||
| #define SIZEOF_INT 4 | ||||
| #define SIZEOF_LONG 8 | ||||
| #define SIZEOF_LONG_LONG 8 | ||||
| #define SIZEOF_DOUBLE 8 | ||||
| #define SIZEOF_WCHAR_T 2 | ||||
| #define HAVE_LONG_LONG 1	/* for ODBC include files */ | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #ifdef _WIN64 | ||||
| #define LENP_OR_POINTER_T SQLLEN * | ||||
| #else | ||||
| #define LENP_OR_POINTER_T SQLPOINTER | ||||
| #endif | ||||
| #else | ||||
| /* #undef LENP_OR_POINTER_T */ | ||||
| #endif | ||||
| /* #undef SIZEOF_SQLWCHAR */ | ||||
| 
 | ||||
| /* #undef WORDS_BIGENDIAN */ | ||||
| 
 | ||||
| /* Does your compiler support `ssize_t' type? (Posix type) */ | ||||
| #ifndef ssize_t | ||||
| /* #undef ssize_t */ | ||||
| #endif | ||||
| 
 | ||||
| /* The size of `__int128', as computed by sizeof. */ | ||||
| #define SIZEOF___INT128 16 | ||||
| 
 | ||||
| /* The size of `__int128_t', as computed by sizeof. */ | ||||
| #define SIZEOF___INT128_T 16 | ||||
| 
 | ||||
| /* The size of `__uint128_t', as computed by sizeof. */ | ||||
| #define SIZEOF___UINT128_T 16 | ||||
| 
 | ||||
| #define HAVE___INT128 1 | ||||
| #define HAVE___INT128_T 1 | ||||
| #define HAVE___UINT128_T 1 | ||||
| /* #undef HAVE_HGE */ | ||||
| 
 | ||||
| #ifdef HAVE_HGE | ||||
| #ifdef HAVE___INT128 | ||||
| typedef __int128 hge; | ||||
| typedef unsigned __int128 uhge; | ||||
| #define SIZEOF_HGE SIZEOF___INT128 | ||||
| #elif defined(HAVE___INT128_T) && defined(HAVE___UINT128_T) | ||||
| typedef __int128_t hge; | ||||
| typedef __uint128_t uhge; | ||||
| #define SIZEOF_HGE SIZEOF___INT128_T | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure sizes
 | ||||
| 
 | ||||
| /* Does your compiler support `__attribute__' extension? */ | ||||
| #if !defined(__GNUC__) && !defined(__clang__) && !defined(__attribute__) | ||||
| #define __attribute__(a) | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(__cplusplus) || __cplusplus < 201103L | ||||
| #ifndef static_assert | ||||
| /* static_assert is a C11/C++11 feature, defined in assert.h which also exists
 | ||||
|  * in many other compilers we ignore it if the compiler doesn't support it | ||||
|  * However in C11 static_assert is a macro, while on C++11 is a keyword */ | ||||
| #define static_assert(expr, mesg)	((void) 0) | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #ifdef HAVE_STRINGS_H | ||||
| #include <strings.h>		/* strcasecmp */ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #define strdup(s)	_strdup(s) | ||||
| 
 | ||||
| #ifndef strcasecmp | ||||
| #define strcasecmp(x,y) _stricmp(x,y) | ||||
| #endif | ||||
| 
 | ||||
| /* Define to 1 if you have the `strncasecmp' function. */ | ||||
| #define HAVE_STRNCASECMP 1 | ||||
| #ifndef strncasecmp | ||||
| #define strncasecmp(x,y,z) _strnicmp(x,y,z) | ||||
| #endif | ||||
| 
 | ||||
| #include <sys/stat.h> | ||||
| #ifdef lstat | ||||
| #undef lstat | ||||
| #endif | ||||
| #define lstat _stat64 | ||||
| #ifdef stat | ||||
| #undef stat | ||||
| #endif | ||||
| #define stat _stat64 | ||||
| #ifdef fstat | ||||
| #undef fstat | ||||
| #endif | ||||
| #define fstat _fstat64 | ||||
| 
 | ||||
| static inline char * | ||||
| stpcpy(char *restrict dst, const char *restrict src) | ||||
| { | ||||
| 	size_t i; | ||||
| 	for (i = 0; src[i]; i++) | ||||
| 		dst[i] = src[i]; | ||||
| 	dst[i] = 0; | ||||
| 	return dst + i; | ||||
| } | ||||
| 
 | ||||
| /* Define to 1 if the system has the type `socklen_t'. */ | ||||
| #define HAVE_SOCKLEN_T 1 | ||||
| /* type used by connect */ | ||||
| #define socklen_t int | ||||
| #define strtok_r(t,d,c) strtok_s(t,d,c) | ||||
| 
 | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| 
 | ||||
| /* there is something very similar to localtime_r on Windows: */ | ||||
| #include <time.h> | ||||
| #define HAVE_LOCALTIME_R 1 | ||||
| static inline struct tm * | ||||
| localtime_r(const time_t *restrict timep, struct tm *restrict result) | ||||
| { | ||||
| 	return localtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| #define HAVE_GMTIME_R 1 | ||||
| static inline struct tm * | ||||
| gmtime_r(const time_t *restrict timep, struct tm *restrict result) | ||||
| { | ||||
| 	return gmtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| 
 | ||||
| /* Define if you have ctime_r(time_t*,char *buf,size_t s) */ | ||||
| #define HAVE_CTIME_R 1 | ||||
| #define HAVE_CTIME_R3 1 | ||||
| /* there is something very similar to ctime_r on Windows: */ | ||||
| #define ctime_r(t,b,s)  (ctime_s(b,s,t) ? NULL : (b)) | ||||
| 
 | ||||
| #endif	/* _MSC_VER */ | ||||
| 
 | ||||
| /* #undef HAVE_SOCKLEN_T */ | ||||
| #ifndef _MSC_VER | ||||
| #define SOCKET int | ||||
| #define closesocket close | ||||
| #endif | ||||
| 
 | ||||
| #ifndef _In_z_ | ||||
| #define _In_z_ | ||||
| #endif | ||||
| #ifndef _Printf_format_string_ | ||||
| #define _Printf_format_string_ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define _LIB_STARTUP_FUNC_(f,q) \ | ||||
|         static void f(void); \ | ||||
|         __declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \ | ||||
|         __pragma(comment(linker,"/include:" q #f "_")) \ | ||||
|         static void f(void) | ||||
| #ifdef _WIN64 | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"") | ||||
| #else | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"_") | ||||
| #endif | ||||
| #else | ||||
| #define LIB_STARTUP_FUNC(f) \ | ||||
|         static void f(void) __attribute__((__constructor__)); \ | ||||
|         static void f(void) | ||||
| #endif | ||||
| 
 | ||||
| #endif /* MT_SEEN_MONETDB_CONFIG_H */ | ||||
| /*
 | ||||
|  * 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 - 2022 MonetDB B.V. | ||||
|  */ | ||||
| /* monetdb_config.h.in.  Generated from CMakeLists.txt  */ | ||||
| 
 | ||||
| #ifndef MT_SEEN_MONETDB_CONFIG_H | ||||
| #define MT_SEEN_MONETDB_CONFIG_H 1 | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #if _MSC_VER < 1900 | ||||
| #error Versions below Visual Studio 2015 are no longer supported | ||||
| #endif | ||||
| 
 | ||||
| /* Prevent pollution through excessive inclusion of include files by Windows.h. */ | ||||
| #ifndef WIN32_LEAN_AND_MEAN | ||||
| #define WIN32_LEAN_AND_MEAN 1 | ||||
| #endif | ||||
| 
 | ||||
| /* Visual Studio 8 has deprecated lots of stuff: suppress warnings */ | ||||
| #ifndef _CRT_SECURE_NO_DEPRECATE | ||||
| #define _CRT_SECURE_NO_DEPRECATE 1 | ||||
| #endif | ||||
| 
 | ||||
| #define _CRT_RAND_S				/* for Windows rand_s, before stdlib.h */ | ||||
| #define HAVE_RAND_S 1 | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(_XOPEN_SOURCE) && defined(__CYGWIN__) | ||||
| #define _XOPEN_SOURCE 700 | ||||
| #endif | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| #if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC) | ||||
| /* In this case, malloc and friends are redefined in crtdbg.h to debug
 | ||||
|  * versions.  We need to include stdlib.h first or else we get | ||||
|  * conflicting declarations. */ | ||||
| #include <crtdbg.h> | ||||
| #endif | ||||
| 
 | ||||
| #define HAVE_SYS_TYPES_H 1 | ||||
| #ifdef HAVE_SYS_TYPES_H | ||||
| # include <sys/types.h> | ||||
| #endif | ||||
| 
 | ||||
| /* standard C-99 include files */ | ||||
| #include <assert.h> | ||||
| #include <errno.h> | ||||
| #include <inttypes.h> | ||||
| #include <stdarg.h> | ||||
| #include <stdbool.h> | ||||
| #include <stddef.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| /* Windows include files */ | ||||
| #include <process.h> | ||||
| #include <windows.h> | ||||
| #include <ws2tcpip.h> | ||||
| 
 | ||||
| /* indicate to sqltypes.h that windows.h has already been included and
 | ||||
|    that it doesn't have to define Windows constants */ | ||||
| #define ALREADY_HAVE_WINDOWS_TYPE 1 | ||||
| 
 | ||||
| #define NATIVE_WIN32 1 | ||||
| 
 | ||||
| #endif /* _MSC_VER */ | ||||
| 
 | ||||
| #if !defined(WIN32) && (defined(__CYGWIN__)||defined(__MINGW32__)) | ||||
| #define WIN32 1 | ||||
| #endif | ||||
| 
 | ||||
| // Section: monetdb configure defines
 | ||||
| /* #undef HAVE_DISPATCH_DISPATCH_H */ | ||||
| #define HAVE_DLFCN_H 1 | ||||
| #define HAVE_FCNTL_H 1 | ||||
| #define HAVE_IO_H 1 | ||||
| /* #undef HAVE_KVM_H */ | ||||
| #define HAVE_LIBGEN_H 1 | ||||
| /* #undef HAVE_LIBINTL_H */ | ||||
| /* #undef HAVE_MACH_MACH_INIT_H */ | ||||
| /* #undef HAVE_MACH_TASK_H */ | ||||
| /* #undef HAVE_MACH_O_DYLD_H */ | ||||
| #define HAVE_NETDB_H 1 | ||||
| #define HAVE_NETINET_IN_H 1 | ||||
| #define HAVE_POLL_H 1 | ||||
| /* #undef HAVE_PROCFS_H */ | ||||
| #define HAVE_PWD_H 1 | ||||
| #define HAVE_STRINGS_H 1 | ||||
| /* #undef HAVE_STROPTS_H */ | ||||
| #define HAVE_SYS_FILE_H 1 | ||||
| #define HAVE_SYS_IOCTL_H 1 | ||||
| /* #undef HAVE_SYS_SYSCTL_H */ | ||||
| #define HAVE_SYS_MMAN_H 1 | ||||
| #define HAVE_SYS_PARAM_H 1 | ||||
| #define HAVE_SYS_RANDOM_H 1 | ||||
| #define HAVE_SYS_RESOURCE_H 1 | ||||
| #define HAVE_SYS_TIME_H 1 | ||||
| #define HAVE_SYS_TIMES_H 1 | ||||
| #define HAVE_SYS_UIO_H 1 | ||||
| #define HAVE_SYS_UN_H 1 | ||||
| #define HAVE_SYS_WAIT_H 1 | ||||
| #define HAVE_TERMIOS_H 1 | ||||
| #define HAVE_UNISTD_H 1 | ||||
| #define HAVE_WINSOCK_H 1 | ||||
| #define HAVE_SEMAPHORE_H 1 | ||||
| #define HAVE_GETOPT_H 1 | ||||
| 
 | ||||
| #define HAVE_STDATOMIC_H 1 | ||||
| 
 | ||||
| #define HAVE_DIRENT_H 1 | ||||
| #define HAVE_SYS_SOCKET_H 1 | ||||
| #define HAVE_GETTIMEOFDAY 1 | ||||
| #define HAVE_SYS_STAT_H 1 | ||||
| #define HAVE_FDATASYNC 1 | ||||
| #define HAVE_ACCEPT4 1 | ||||
| #define HAVE_ASCTIME_R 1 | ||||
| #define HAVE_CLOCK_GETTIME 1 | ||||
| #define HAVE_CTIME_R 1 | ||||
| /* #undef HAVE_DISPATCH_SEMAPHORE_CREATE */ | ||||
| /* #undef HAVE_FALLOCATE */ | ||||
| #define HAVE_FCNTL 1 | ||||
| #define HAVE_FORK 1 | ||||
| #define HAVE_FSYNC 1 | ||||
| #define HAVE_FTIME 1 | ||||
| #define HAVE_GETENTROPY 1 | ||||
| /* #undef HAVE_GETEXECNAME */ | ||||
| #define HAVE_GETLOGIN 1 | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| #define HAVE_GETRLIMIT 1 | ||||
| #define HAVE_GETTIMEOFDAY 1 | ||||
| #define HAVE_GETUID 1 | ||||
| #define HAVE_GMTIME_R 1 | ||||
| #define HAVE_LOCALTIME_R 1 | ||||
| #define HAVE_STRERROR_R 1 | ||||
| #define HAVE_LOCKF 1 | ||||
| #define HAVE_MADVISE  1 | ||||
| /* #undef HAVE_MREMAP */ | ||||
| #define HAVE_NANOSLEEP  1 | ||||
| #define HAVE_NL_LANGINFO  1 | ||||
| /* #undef HAVE__NSGETEXECUTABLEPATH */ | ||||
| /* #undef HAVE_PIPE2 */ | ||||
| #define HAVE_POLL  1 | ||||
| #define HAVE_POPEN 1 | ||||
| #define HAVE_POSIX_FADVISE 1 | ||||
| #define HAVE_POSIX_FALLOCATE 1 | ||||
| #define HAVE_POSIX_MADVISE 1 | ||||
| #define HAVE_PUTENV 1 | ||||
| #define HAVE_SETSID 1 | ||||
| #define HAVE_SHUTDOWN 1 | ||||
| #define HAVE_SIGACTION 1 | ||||
| #define HAVE_STPCPY 1 | ||||
| #define HAVE_STRCASESTR 1 | ||||
| #define HAVE_STRNCASECMP 1 | ||||
| #define HAVE_STRPTIME 1 | ||||
| #define HAVE_STRSIGNAL 1 | ||||
| #define HAVE_SYSCONF 1 | ||||
| /* #undef HAVE_TASK_INFO */ | ||||
| #define HAVE_TIMES 1 | ||||
| #define HAVE_UNAME 1 | ||||
| /* #undef HAVE_SEMTIMEDOP */ | ||||
| #define HAVE_PTHREAD_KILL 1 | ||||
| #define HAVE_PTHREAD_SIGMASK 1 | ||||
| #define HAVE_GETOPT 1 | ||||
| 
 | ||||
| #define ICONV_CONST | ||||
| #define FLEXIBLE_ARRAY_MEMBER | ||||
| #define ENABLE_MAPI 1 | ||||
| #define HAVE_MAPI 1 | ||||
| // End Section: monetdb configure defines
 | ||||
| 
 | ||||
| // Section: monetdb macro variables
 | ||||
| /* #undef HAVE_ICONV */ | ||||
| #define HAVE_PTHREAD_H 1 | ||||
| /* #undef HAVE_LIBPCRE */ | ||||
| /* #undef HAVE_LIBBZ2 */ | ||||
| /* #undef HAVE_CURL */ | ||||
| /* #undef HAVE_LIBLZMA */ | ||||
| /* #undef HAVE_LIBXML */ | ||||
| /* #undef HAVE_LIBZ */ | ||||
| /* #undef HAVE_LIBLZ4 */ | ||||
| /* #undef HAVE_PROJ */ | ||||
| /* #undef HAVE_SNAPPY */ | ||||
| /* #undef HAVE_FITS */ | ||||
| /* #undef HAVE_VALGRIND */ | ||||
| /* #undef HAVE_NETCDF */ | ||||
| /* #undef HAVE_READLINE */ | ||||
| /* #undef HAVE_LIBR */ | ||||
| #define RHOME "/registry" | ||||
| /* #undef HAVE_GEOM */ | ||||
| /* #undef HAVE_SHP */ | ||||
| /* #undef HAVE_LIBPY3 */ | ||||
| 
 | ||||
| // #define SOCKET_LIBRARIES
 | ||||
| #define HAVE_GETADDRINFO 1 | ||||
| /* #undef HAVE_CUDF */ | ||||
| 
 | ||||
| #define MAPI_PORT 50000 | ||||
| #define MAPI_PORT_STR "50000" | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define DIR_SEP '\\' | ||||
| #define PATH_SEP ';' | ||||
| #define DIR_SEP_STR "\\" | ||||
| #define SO_PREFIX "" | ||||
| #else | ||||
| #define DIR_SEP '/' | ||||
| #define PATH_SEP ':' | ||||
| #define DIR_SEP_STR "/" | ||||
| #define SO_PREFIX "lib" | ||||
| #endif | ||||
| #define SO_EXT ".dll" | ||||
| 
 | ||||
| #define BINDIR "C:/Program Files (x86)/MonetDB/bin" | ||||
| #define LIBDIR "C:/Program Files (x86)/MonetDB/lib" | ||||
| #define LOCALSTATEDIR "C:/Program Files (x86)/MonetDB/var" | ||||
| 
 | ||||
| // End Section: monetdb macro variables
 | ||||
| 
 | ||||
| // Section: monetdb configure misc
 | ||||
| #define MONETDB_RELEASE "unreleased" | ||||
| 
 | ||||
| #define MONETDB_VERSION "11.44.0" | ||||
| #define MONETDB_VERSION_MAJOR 11 | ||||
| #define MONETDB_VERSION_MINOR 44 | ||||
| #define MONETDB_VERSION_PATCH 0 | ||||
| 
 | ||||
| #define GDK_VERSION "25.1.0" | ||||
| #define GDK_VERSION_MAJOR 25 | ||||
| #define GDK_VERSION_MINOR 1 | ||||
| #define GDK_VERSION_PATCH 0 | ||||
| #define MAPI_VERSION "14.0.2" | ||||
| #define MAPI_VERSION_MAJOR 14 | ||||
| #define MAPI_VERSION_MINOR 0 | ||||
| #define MAPI_VERSION_PATCH 2 | ||||
| #define MONETDB5_VERSION "32.0.6" | ||||
| #define MONETDB5_VERSION_MAJOR 32 | ||||
| #define MONETDB5_VERSION_MINOR 0 | ||||
| #define MONETDB5_VERSION_PATCH 6 | ||||
| #define MONETDBE_VERSION "3.0.2" | ||||
| #define MONETDBE_VERSION_MAJOR 3 | ||||
| #define MONETDBE_VERSION_MINOR 0 | ||||
| #define MONETDBE_VERSION_PATCH 2 | ||||
| #define STREAM_VERSION "16.0.1" | ||||
| #define STREAM_VERSION_MAJOR 16 | ||||
| #define STREAM_VERSION_MINOR 0 | ||||
| #define STREAM_VERSION_PATCH 1 | ||||
| #define SQL_VERSION "12.0.5" | ||||
| #define SQL_VERSION_MAJOR 12 | ||||
| #define SQL_VERSION_MINOR 0 | ||||
| #define SQL_VERSION_PATCH 5 | ||||
| 
 | ||||
| /* Host identifier */ | ||||
| #define HOST "amd64-pc-windows-gnu" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH "SHA512" | ||||
| 
 | ||||
| /* The used password hash algorithm */ | ||||
| #define MONETDB5_PASSWDHASH_TOKEN SHA512 | ||||
| 
 | ||||
| #ifndef _Noreturn | ||||
| #ifdef __cplusplus | ||||
| #define _Noreturn | ||||
| #else | ||||
| /* #undef _Noreturn */ | ||||
| #endif | ||||
| #endif | ||||
| /* Does your compiler support `inline' keyword? (C99 feature) */ | ||||
| #ifndef inline | ||||
| #ifdef __cplusplus | ||||
| #define inline | ||||
| #else | ||||
| /* #undef inline */ | ||||
| #endif | ||||
| #endif | ||||
| /* Does your compiler support `restrict' keyword? (C99 feature) */ | ||||
| #ifndef restrict | ||||
| #ifdef __cplusplus | ||||
| #define restrict | ||||
| #else | ||||
| /* #undef restrict */ | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure misc
 | ||||
| 
 | ||||
| // Section: monetdb configure sizes
 | ||||
| #define SIZEOF_SIZE_T 8 | ||||
| 
 | ||||
| /* The size of `void *', as computed by sizeof. */ | ||||
| #define SIZEOF_VOID_P 8 | ||||
| 
 | ||||
| #define SIZEOF_CHAR 1 | ||||
| #define SIZEOF_SHORT 2 | ||||
| #define SIZEOF_INT 4 | ||||
| #define SIZEOF_LONG 8 | ||||
| #define SIZEOF_LONG_LONG 8 | ||||
| #define SIZEOF_DOUBLE 8 | ||||
| #define SIZEOF_WCHAR_T 2 | ||||
| #define HAVE_LONG_LONG 1	/* for ODBC include files */ | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #ifdef _WIN64 | ||||
| #define LENP_OR_POINTER_T SQLLEN * | ||||
| #else | ||||
| #define LENP_OR_POINTER_T SQLPOINTER | ||||
| #endif | ||||
| #else | ||||
| /* #undef LENP_OR_POINTER_T */ | ||||
| #endif | ||||
| /* #undef SIZEOF_SQLWCHAR */ | ||||
| 
 | ||||
| /* #undef WORDS_BIGENDIAN */ | ||||
| 
 | ||||
| /* Does your compiler support `ssize_t' type? (Posix type) */ | ||||
| #ifndef ssize_t | ||||
| /* #undef ssize_t */ | ||||
| #endif | ||||
| 
 | ||||
| /* The size of `__int128', as computed by sizeof. */ | ||||
| #define SIZEOF___INT128 16 | ||||
| 
 | ||||
| /* The size of `__int128_t', as computed by sizeof. */ | ||||
| #define SIZEOF___INT128_T 16 | ||||
| 
 | ||||
| /* The size of `__uint128_t', as computed by sizeof. */ | ||||
| #define SIZEOF___UINT128_T 16 | ||||
| 
 | ||||
| #define HAVE___INT128 1 | ||||
| #define HAVE___INT128_T 1 | ||||
| #define HAVE___UINT128_T 1 | ||||
| /* #undef HAVE_HGE */ | ||||
| 
 | ||||
| #ifdef HAVE_HGE | ||||
| #ifdef HAVE___INT128 | ||||
| typedef __int128 hge; | ||||
| typedef unsigned __int128 uhge; | ||||
| #define SIZEOF_HGE SIZEOF___INT128 | ||||
| #elif defined(HAVE___INT128_T) && defined(HAVE___UINT128_T) | ||||
| typedef __int128_t hge; | ||||
| typedef __uint128_t uhge; | ||||
| #define SIZEOF_HGE SIZEOF___INT128_T | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| // End Section: monetdb configure sizes
 | ||||
| 
 | ||||
| /* Does your compiler support `__attribute__' extension? */ | ||||
| #if !defined(__GNUC__) && !defined(__clang__) && !defined(__attribute__) | ||||
| #define __attribute__(a) | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(__cplusplus) || __cplusplus < 201103L | ||||
| #ifndef static_assert | ||||
| /* static_assert is a C11/C++11 feature, defined in assert.h which also exists
 | ||||
|  * in many other compilers we ignore it if the compiler doesn't support it | ||||
|  * However in C11 static_assert is a macro, while on C++11 is a keyword */ | ||||
| #define static_assert(expr, mesg)	((void) 0) | ||||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #ifdef HAVE_STRINGS_H | ||||
| #include <strings.h>		/* strcasecmp */ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| 
 | ||||
| #define strdup(s)	_strdup(s) | ||||
| 
 | ||||
| #ifndef strcasecmp | ||||
| #define strcasecmp(x,y) _stricmp(x,y) | ||||
| #endif | ||||
| 
 | ||||
| /* Define to 1 if you have the `strncasecmp' function. */ | ||||
| #define HAVE_STRNCASECMP 1 | ||||
| #ifndef strncasecmp | ||||
| #define strncasecmp(x,y,z) _strnicmp(x,y,z) | ||||
| #endif | ||||
| 
 | ||||
| #include <sys/stat.h> | ||||
| #ifdef lstat | ||||
| #undef lstat | ||||
| #endif | ||||
| #define lstat _stat64 | ||||
| #ifdef stat | ||||
| #undef stat | ||||
| #endif | ||||
| #define stat _stat64 | ||||
| #ifdef fstat | ||||
| #undef fstat | ||||
| #endif | ||||
| #define fstat _fstat64 | ||||
| 
 | ||||
| static inline char * | ||||
| stpcpy(char *restrict dst, const char *restrict src) | ||||
| { | ||||
| 	size_t i; | ||||
| 	for (i = 0; src[i]; i++) | ||||
| 		dst[i] = src[i]; | ||||
| 	dst[i] = 0; | ||||
| 	return dst + i; | ||||
| } | ||||
| 
 | ||||
| /* Define to 1 if the system has the type `socklen_t'. */ | ||||
| #define HAVE_SOCKLEN_T 1 | ||||
| /* type used by connect */ | ||||
| #define socklen_t int | ||||
| #define strtok_r(t,d,c) strtok_s(t,d,c) | ||||
| 
 | ||||
| #define HAVE_GETOPT_LONG 1 | ||||
| 
 | ||||
| /* there is something very similar to localtime_r on Windows: */ | ||||
| #include <time.h> | ||||
| #define HAVE_LOCALTIME_R 1 | ||||
| static inline struct tm * | ||||
| localtime_r(const time_t *restrict timep, struct tm *restrict result) | ||||
| { | ||||
| 	return localtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| #define HAVE_GMTIME_R 1 | ||||
| static inline struct tm * | ||||
| gmtime_r(const time_t *restrict timep, struct tm *restrict result) | ||||
| { | ||||
| 	return gmtime_s(result, timep) == 0 ? result : NULL; | ||||
| } | ||||
| 
 | ||||
| /* Define if you have ctime_r(time_t*,char *buf,size_t s) */ | ||||
| #define HAVE_CTIME_R 1 | ||||
| #define HAVE_CTIME_R3 1 | ||||
| /* there is something very similar to ctime_r on Windows: */ | ||||
| #define ctime_r(t,b,s)  (ctime_s(b,s,t) ? NULL : (b)) | ||||
| 
 | ||||
| #endif	/* _MSC_VER */ | ||||
| 
 | ||||
| /* #undef HAVE_SOCKLEN_T */ | ||||
| #ifndef _MSC_VER | ||||
| #define SOCKET int | ||||
| #define closesocket close | ||||
| #endif | ||||
| 
 | ||||
| #ifndef _In_z_ | ||||
| #define _In_z_ | ||||
| #endif | ||||
| #ifndef _Printf_format_string_ | ||||
| #define _Printf_format_string_ | ||||
| #endif | ||||
| 
 | ||||
| #ifdef _MSC_VER | ||||
| #define _LIB_STARTUP_FUNC_(f,q) \ | ||||
|         static void f(void); \ | ||||
|         __declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \ | ||||
|         __pragma(comment(linker,"/include:" q #f "_")) \ | ||||
|         static void f(void) | ||||
| #ifdef _WIN64 | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"") | ||||
| #else | ||||
|         #define LIB_STARTUP_FUNC(f) _LIB_STARTUP_FUNC_(f,"_") | ||||
| #endif | ||||
| #else | ||||
| #define LIB_STARTUP_FUNC(f) \ | ||||
|         static void f(void) __attribute__((__constructor__)); \ | ||||
|         static void f(void) | ||||
| #endif | ||||
| 
 | ||||
| #endif /* MT_SEEN_MONETDB_CONFIG_H */ | ||||
|  | ||||
| @ -1,190 +1,190 @@ | ||||
| /*
 | ||||
|  * 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 - 2022 MonetDB B.V. | ||||
|  */ | ||||
| 
 | ||||
| #ifndef _MONETDBE_LIB_ | ||||
| #define _MONETDBE_LIB_ | ||||
| 
 | ||||
| #include "monetdb_config.h" | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| #include <stdint.h> | ||||
| 
 | ||||
| #ifdef WIN32 | ||||
| #ifndef LIBMONETDBE | ||||
| #define monetdbe_export extern __declspec(dllimport) | ||||
| #else | ||||
| #define monetdbe_export extern __declspec(dllexport) | ||||
| #endif | ||||
| #else | ||||
| #define monetdbe_export extern | ||||
| #endif | ||||
| 
 | ||||
| typedef int64_t monetdbe_cnt; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	unsigned char day; | ||||
| 	unsigned char month; | ||||
| 	short year; | ||||
| } monetdbe_data_date; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	unsigned int ms; | ||||
| 	unsigned char seconds; | ||||
| 	unsigned char minutes; | ||||
| 	unsigned char hours; | ||||
| } monetdbe_data_time; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	monetdbe_data_date date; | ||||
| 	monetdbe_data_time time; | ||||
| } monetdbe_data_timestamp; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	size_t size; | ||||
| 	char* data; | ||||
| } monetdbe_data_blob; | ||||
| 
 | ||||
| typedef enum  { | ||||
| 	monetdbe_bool, monetdbe_int8_t, monetdbe_int16_t, monetdbe_int32_t, monetdbe_int64_t, | ||||
| #ifdef HAVE_HGE | ||||
| 	monetdbe_int128_t, | ||||
| #endif | ||||
| 	monetdbe_size_t, monetdbe_float, monetdbe_double, | ||||
| 	monetdbe_str, monetdbe_blob, | ||||
| 	monetdbe_date, monetdbe_time, monetdbe_timestamp, | ||||
| 
 | ||||
| 	// should be last:
 | ||||
| 	monetdbe_type_unknown | ||||
| } monetdbe_types; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	char* name; | ||||
| 	unsigned int scale; | ||||
| 	unsigned int digits; | ||||
| } monetdbe_sql_type; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	monetdbe_types type; | ||||
| 	monetdbe_sql_type sql_type; | ||||
| 	void *data; | ||||
| 	size_t count; | ||||
| 	char* name; | ||||
| } monetdbe_column; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	size_t nparam; | ||||
| 	monetdbe_types  *type; | ||||
| } monetdbe_statement; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	monetdbe_cnt nrows; | ||||
| 	size_t ncols; | ||||
| 	char *name; | ||||
| 	monetdbe_cnt last_id;		/* last auto incremented id */ | ||||
| } monetdbe_result; | ||||
| 
 | ||||
| typedef void* monetdbe_database; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	const char *host; | ||||
| 	int port; | ||||
| 	const char *database; | ||||
| 	const char *username; | ||||
| 	const char *password; | ||||
| 	const char *lang; | ||||
| } monetdbe_remote; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	const char *host; | ||||
| 	const char* port; | ||||
| 	const char* usock; | ||||
| } monetdbe_mapi_server; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	int memorylimit;  // top off the amount of RAM to be used, in MB
 | ||||
| 	int querytimeout;  // graceful terminate query after a few seconds
 | ||||
| 	int sessiontimeout;  // graceful terminate the session after a few seconds
 | ||||
| 	int nr_threads;  // maximum number of worker treads, limits level of parallelism
 | ||||
| 	monetdbe_remote* remote; | ||||
| 	monetdbe_mapi_server* mapi_server; | ||||
| 	const char *trace_file;		// file to which log output should be written
 | ||||
| } monetdbe_options; | ||||
| 
 | ||||
| #define DEFAULT_STRUCT_DEFINITION(ctype, typename)         \ | ||||
| 	typedef struct                                     \ | ||||
| 	{                                                  \ | ||||
| 		monetdbe_types type;                        \ | ||||
| 		monetdbe_sql_type sql_type;                \ | ||||
| 		ctype *data;                               \ | ||||
| 		size_t count;                              \ | ||||
| 		char *name;				   \ | ||||
| 		ctype null_value;                          \ | ||||
| 		double scale;                              \ | ||||
| 		int (*is_null)(ctype *value);               \ | ||||
| 	} monetdbe_column_##typename | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(int8_t, bool); | ||||
| DEFAULT_STRUCT_DEFINITION(int8_t, int8_t); | ||||
| DEFAULT_STRUCT_DEFINITION(int16_t, int16_t); | ||||
| DEFAULT_STRUCT_DEFINITION(int32_t, int32_t); | ||||
| DEFAULT_STRUCT_DEFINITION(int64_t, int64_t); | ||||
| #ifdef HAVE_HGE | ||||
| DEFAULT_STRUCT_DEFINITION(__int128, int128_t); | ||||
| #endif | ||||
| DEFAULT_STRUCT_DEFINITION(size_t, size_t); | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(float, float); | ||||
| DEFAULT_STRUCT_DEFINITION(double, double); | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(char *, str); | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_blob, blob); | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_date, date); | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_time, time); | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_timestamp, timestamp); | ||||
| // UUID, INET, XML ?
 | ||||
| 
 | ||||
| monetdbe_export const char *monetdbe_version(void); | ||||
| 
 | ||||
| monetdbe_export int   monetdbe_open(monetdbe_database *db, char *url, monetdbe_options *opts); | ||||
| /* 0 ok, -1 (allocation failed),  -2 error in db */ | ||||
| monetdbe_export int   monetdbe_close(monetdbe_database db); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_error(monetdbe_database db); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_get_autocommit(monetdbe_database dbhdl, int* result); | ||||
| monetdbe_export char* monetdbe_set_autocommit(monetdbe_database dbhdl, int value); | ||||
| monetdbe_export int   monetdbe_in_transaction(monetdbe_database dbhdl); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_query(monetdbe_database dbhdl, char* query, monetdbe_result** result, monetdbe_cnt* affected_rows); | ||||
| monetdbe_export char* monetdbe_result_fetch(monetdbe_result *mres, monetdbe_column** res, size_t column_index); | ||||
| monetdbe_export char* monetdbe_cleanup_result(monetdbe_database dbhdl, monetdbe_result* result); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_prepare(monetdbe_database dbhdl, char *query, monetdbe_statement **stmt, monetdbe_result** result); | ||||
| monetdbe_export char* monetdbe_bind(monetdbe_statement *stmt, void *data, size_t parameter_nr); | ||||
| monetdbe_export char* monetdbe_execute(monetdbe_statement *stmt, monetdbe_result **result, monetdbe_cnt* affected_rows); | ||||
| monetdbe_export char* monetdbe_cleanup_statement(monetdbe_database dbhdl, monetdbe_statement *stmt); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_append(monetdbe_database dbhdl, const char* schema, const char* table, monetdbe_column **input, size_t column_count); | ||||
| monetdbe_export const void* monetdbe_null(monetdbe_database dbhdl, monetdbe_types t); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_get_columns(monetdbe_database dbhdl, const char* schema_name, const char *table_name, size_t *column_count, monetdbe_column **columns); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_dump_database(monetdbe_database dbhdl, const char *backupfile); | ||||
| monetdbe_export char* monetdbe_dump_table(monetdbe_database dbhdl, const char *schema_name, const char *table_name, const char *backupfile); | ||||
| monetdbe_export const char* monetdbe_get_mapi_port(void); | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| 
 | ||||
| #endif | ||||
| /*
 | ||||
|  * 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 - 2022 MonetDB B.V. | ||||
|  */ | ||||
| 
 | ||||
| #ifndef _MONETDBE_LIB_ | ||||
| #define _MONETDBE_LIB_ | ||||
| 
 | ||||
| #include "monetdb_config.h" | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| #include <stdint.h> | ||||
| 
 | ||||
| #ifdef WIN32 | ||||
| #ifndef LIBMONETDBE | ||||
| #define monetdbe_export extern __declspec(dllimport) | ||||
| #else | ||||
| #define monetdbe_export extern __declspec(dllexport) | ||||
| #endif | ||||
| #else | ||||
| #define monetdbe_export extern | ||||
| #endif | ||||
| 
 | ||||
| typedef int64_t monetdbe_cnt; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	unsigned char day; | ||||
| 	unsigned char month; | ||||
| 	short year; | ||||
| } monetdbe_data_date; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	unsigned int ms; | ||||
| 	unsigned char seconds; | ||||
| 	unsigned char minutes; | ||||
| 	unsigned char hours; | ||||
| } monetdbe_data_time; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	monetdbe_data_date date; | ||||
| 	monetdbe_data_time time; | ||||
| } monetdbe_data_timestamp; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	size_t size; | ||||
| 	char* data; | ||||
| } monetdbe_data_blob; | ||||
| 
 | ||||
| typedef enum  { | ||||
| 	monetdbe_bool, monetdbe_int8_t, monetdbe_int16_t, monetdbe_int32_t, monetdbe_int64_t, | ||||
| #ifdef HAVE_HGE | ||||
| 	monetdbe_int128_t, | ||||
| #endif | ||||
| 	monetdbe_size_t, monetdbe_float, monetdbe_double, | ||||
| 	monetdbe_str, monetdbe_blob, | ||||
| 	monetdbe_date, monetdbe_time, monetdbe_timestamp, | ||||
| 
 | ||||
| 	// should be last:
 | ||||
| 	monetdbe_type_unknown | ||||
| } monetdbe_types; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	char* name; | ||||
| 	unsigned int scale; | ||||
| 	unsigned int digits; | ||||
| } monetdbe_sql_type; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	monetdbe_types type; | ||||
| 	monetdbe_sql_type sql_type; | ||||
| 	void *data; | ||||
| 	size_t count; | ||||
| 	char* name; | ||||
| } monetdbe_column; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	size_t nparam; | ||||
| 	monetdbe_types  *type; | ||||
| } monetdbe_statement; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	monetdbe_cnt nrows; | ||||
| 	size_t ncols; | ||||
| 	char *name; | ||||
| 	monetdbe_cnt last_id;		/* last auto incremented id */ | ||||
| } monetdbe_result; | ||||
| 
 | ||||
| typedef void* monetdbe_database; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	const char *host; | ||||
| 	int port; | ||||
| 	const char *database; | ||||
| 	const char *username; | ||||
| 	const char *password; | ||||
| 	const char *lang; | ||||
| } monetdbe_remote; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	const char *host; | ||||
| 	const char* port; | ||||
| 	const char* usock; | ||||
| } monetdbe_mapi_server; | ||||
| 
 | ||||
| typedef struct { | ||||
| 	int memorylimit;  // top off the amount of RAM to be used, in MB
 | ||||
| 	int querytimeout;  // graceful terminate query after a few seconds
 | ||||
| 	int sessiontimeout;  // graceful terminate the session after a few seconds
 | ||||
| 	int nr_threads;  // maximum number of worker treads, limits level of parallelism
 | ||||
| 	monetdbe_remote* remote; | ||||
| 	monetdbe_mapi_server* mapi_server; | ||||
| 	const char *trace_file;		// file to which log output should be written
 | ||||
| } monetdbe_options; | ||||
| 
 | ||||
| #define DEFAULT_STRUCT_DEFINITION(ctype, typename)         \ | ||||
| 	typedef struct                                     \ | ||||
| 	{                                                  \ | ||||
| 		monetdbe_types type;                        \ | ||||
| 		monetdbe_sql_type sql_type;                \ | ||||
| 		ctype *data;                               \ | ||||
| 		size_t count;                              \ | ||||
| 		char *name;				   \ | ||||
| 		ctype null_value;                          \ | ||||
| 		double scale;                              \ | ||||
| 		int (*is_null)(ctype *value);               \ | ||||
| 	} monetdbe_column_##typename | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(int8_t, bool); | ||||
| DEFAULT_STRUCT_DEFINITION(int8_t, int8_t); | ||||
| DEFAULT_STRUCT_DEFINITION(int16_t, int16_t); | ||||
| DEFAULT_STRUCT_DEFINITION(int32_t, int32_t); | ||||
| DEFAULT_STRUCT_DEFINITION(int64_t, int64_t); | ||||
| #ifdef HAVE_HGE | ||||
| DEFAULT_STRUCT_DEFINITION(__int128, int128_t); | ||||
| #endif | ||||
| DEFAULT_STRUCT_DEFINITION(size_t, size_t); | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(float, float); | ||||
| DEFAULT_STRUCT_DEFINITION(double, double); | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(char *, str); | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_blob, blob); | ||||
| 
 | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_date, date); | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_time, time); | ||||
| DEFAULT_STRUCT_DEFINITION(monetdbe_data_timestamp, timestamp); | ||||
| // UUID, INET, XML ?
 | ||||
| 
 | ||||
| monetdbe_export const char *monetdbe_version(void); | ||||
| 
 | ||||
| monetdbe_export int   monetdbe_open(monetdbe_database *db, char *url, monetdbe_options *opts); | ||||
| /* 0 ok, -1 (allocation failed),  -2 error in db */ | ||||
| monetdbe_export int   monetdbe_close(monetdbe_database db); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_error(monetdbe_database db); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_get_autocommit(monetdbe_database dbhdl, int* result); | ||||
| monetdbe_export char* monetdbe_set_autocommit(monetdbe_database dbhdl, int value); | ||||
| monetdbe_export int   monetdbe_in_transaction(monetdbe_database dbhdl); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_query(monetdbe_database dbhdl, char* query, monetdbe_result** result, monetdbe_cnt* affected_rows); | ||||
| monetdbe_export char* monetdbe_result_fetch(monetdbe_result *mres, monetdbe_column** res, size_t column_index); | ||||
| monetdbe_export char* monetdbe_cleanup_result(monetdbe_database dbhdl, monetdbe_result* result); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_prepare(monetdbe_database dbhdl, char *query, monetdbe_statement **stmt, monetdbe_result** result); | ||||
| monetdbe_export char* monetdbe_bind(monetdbe_statement *stmt, void *data, size_t parameter_nr); | ||||
| monetdbe_export char* monetdbe_execute(monetdbe_statement *stmt, monetdbe_result **result, monetdbe_cnt* affected_rows); | ||||
| monetdbe_export char* monetdbe_cleanup_statement(monetdbe_database dbhdl, monetdbe_statement *stmt); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_append(monetdbe_database dbhdl, const char* schema, const char* table, monetdbe_column **input, size_t column_count); | ||||
| monetdbe_export const void* monetdbe_null(monetdbe_database dbhdl, monetdbe_types t); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_get_columns(monetdbe_database dbhdl, const char* schema_name, const char *table_name, size_t *column_count, monetdbe_column **columns); | ||||
| 
 | ||||
| monetdbe_export char* monetdbe_dump_database(monetdbe_database dbhdl, const char *backupfile); | ||||
| monetdbe_export char* monetdbe_dump_table(monetdbe_database dbhdl, const char *schema_name, const char *table_name, const char *backupfile); | ||||
| monetdbe_export const char* monetdbe_get_mapi_port(void); | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| 
 | ||||
| #endif | ||||
|  | ||||
											
												Binary file not shown.
											
										
									
								| @ -1,21 +1,31 @@ | ||||
| #include "./server/libaquery.h" | ||||
| #include "./server/aggregations.h" | ||||
| #include "./udf.hpp" | ||||
| #include "./server/hasher.h" | ||||
| #include <unordered_map> | ||||
| #include "./server/monetdb_conn.h" | ||||
| #include "./server/aggregations.h" | ||||
| #include "./server/libaquery.h" | ||||
| 
 | ||||
|     extern "C" int __DLLEXPORT__ dllmain(Context* cxt) {  | ||||
|         using namespace std; | ||||
|         using namespace types; | ||||
|         auto server = static_cast<Server*>(cxt->alt_server); | ||||
|     auto len_6WMRXO = server->cnt; | ||||
| auto suma_6BP = ColRef<int64_t>(len_6WMRXO, server->getCol(0)); | ||||
| auto b_5Yb = ColRef<int>(len_6WMRXO, server->getCol(1)); | ||||
| auto c_2Vh = ColRef<int>(len_6WMRXO, server->getCol(2)); | ||||
| auto d_1Ma = ColRef<int>(len_6WMRXO, server->getCol(3)); | ||||
| auto out_2URo7p = new TableInfo<value_type<decays<decltype((paircorr(c_2Vh, b_5Yb) * d_1Ma))>>,int64_t,int>("out_2URo7p"); | ||||
| out_2URo7p->get_col<0>() = (paircorr(c_2Vh, b_5Yb) * d_1Ma); | ||||
| out_2URo7p->get_col<1>().initfrom(suma_6BP); | ||||
| out_2URo7p->get_col<2>().initfrom(b_5Yb); | ||||
| print(*out_2URo7p); | ||||
|     auto len_4fxytV = server->cnt; | ||||
| auto b_3pr = ColRef<int>(len_4fxytV, server->getCol(0)); | ||||
| auto a_65L = ColRef<int>(len_4fxytV, server->getCol(1)); | ||||
| auto out_2UnEpP = new TableInfo<value_type<decays<decltype(covariances2_gettype(a_65L, b_3pr, 4))>>>("out_2UnEpP"); | ||||
| auto col_C9QF0Z = out_2UnEpP->get_col<0>(); | ||||
| for (uint32_t i41 = 0; i41 < t1K4f4I0.size; ++i41){ | ||||
| g1zdpLFa[forward_as_tuple(t1K4f4I0[i41])].emplace_back(i41); | ||||
| } | ||||
| for (const auto& i40 : g1zdpLFa){ | ||||
| auto &len_5NTOM6m = val_2423Z8E.size; | ||||
| auto &key_6fZPUDS = i4O.first; | ||||
| auto &val_2423Z8E = i4O.second; | ||||
| col_C9QF0Z.emplace_back({len_5NTOM6m}); | ||||
| 
 | ||||
| covariances2(a_65L[val_2423Z8E], b_3pr[val_2423Z8E], 4, len_5NTOM6m, col_C9QF0Z.back()); | ||||
| 
 | ||||
| } | ||||
| print(*out_2UnEpP); | ||||
| return 0; | ||||
| } | ||||
| @ -1,32 +0,0 @@ | ||||
| Exception: STATUS_ACCESS_VIOLATION at rip=005A43E1EE8 | ||||
| rax=000000080016C970 rbx=00000000FFFFC2E0 rcx=0000000000000015 | ||||
| rdx=00000000FFFFCE00 rsi=0000000000000000 rdi=0000000000000002 | ||||
| r8 =00000000000000A8 r9 =000000080016C970 r10=0000000000005150 | ||||
| r11=000000080016C970 r12=00000000FFFFFFFF r13=0000000000000000 | ||||
| r14=00006FFFFFEBA2F8 r15=00000000FFFFC380 | ||||
| rbp=00000000FFFFC210 rsp=00000000FFFFC160 | ||||
| program=C:\msys64\usr\bin\python3.exe, pid 821, thread main | ||||
| cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B | ||||
| Stack trace: | ||||
| Frame        Function    Args | ||||
| 000FFFFC210  005A43E1EE8 (00000000000, 0057B699D00, 00000000050, 000FFFFC2A0) | ||||
| 000FFFFC210  00487B249A1 (0000000000A, 000FFFFC2F0, 00000000002, 000FFFFC3A0) | ||||
| 000FFFFC2A0  00487B245EE (000FFFC68F0, 00000000002, 6FFFFFEBA2F8, 00000000000) | ||||
| 000FFFFC3A0  00487B247B2 (004484CACEA, 00800187A50, 004484CACDA, 000FFFFC2D0) | ||||
| 000FFFFC3A0  004484CAE74 (0057B4D31A2, 00500001101, 00000000000, 00800187A50) | ||||
| 00000000000  004484C476D (6FFFFFF97DF0, 00000000000, 0057B539C7B, 6FFFFFE9AF40) | ||||
| 004484C4660  0057B509F6F (6FFFFFFC68F0, 6FFFFFEA2330, 0057B547BA7, 00000000000) | ||||
| 00800048F80  0057B6910D9 (0080016ABE0, 6FFF00000000, 0057B68A0EA, 0057B72B2E0) | ||||
| 00000000000  0057B5D0C61 (6FFFFFE9F190, 000FFFFC7F0, 0057B5E3A05, 00000000000) | ||||
| 6FFFFFF30220  0057B5D0FD1 (0080016ABF0, 6FFFFFF93D30, 0057B618338, 6FFFFFF34D00) | ||||
| 6FFFFFF30220  0057B60C6B0 (6FFFFFE9A0B0, 0080004A920, 6FFFFFE9F190, 6FFFFFEE2610) | ||||
| 6FFFFFF30220  0057B60C8B4 (0057B50A49A, 00000000000, 0057B539B2F, 000FFFFCAB8) | ||||
| 6FFFFFF30220  0057B60EE21 (00000000000, 000FFFFCAB8, 00000000001, 0057B731792) | ||||
| 0057B699678  0057B60F0B6 (0057B618804, 000FFFFCD30, 0057B604F54, 00800049350) | ||||
| 000FFFFCD30  0057B60FA20 (00000000000, 000FFFFC968, 000FFFFCD30, 00000000001) | ||||
| 000FFFFCD30  0057B62ABDD (001004016D0, 001004016D0, 00000000000, 000FFFFCD30) | ||||
| 000FFFFCD30  0057B62AE9D (00180049B25, 00180048A40, 00000000002, 00180326FE0) | ||||
| 000FFFFCD30  00180049B91 (00000000000, 00000000000, 00000000000, 00000000000) | ||||
| 000FFFFFFF0  00180047716 (00000000000, 00000000000, 00000000000, 00000000000) | ||||
| 000FFFFFFF0  001800477C4 (00000000000, 00000000000, 00000000000, 00000000000) | ||||
| End of stack trace | ||||
| @ -0,0 +1,11 @@ | ||||
| # TODO: | ||||
| 
 | ||||
| ## 1. double scans in projections  | ||||
|    - first for special aggrigations and singular columns | ||||
|    - Then in group by node decide if we have special group by aggregations | ||||
|    - If sp_gb_agg exists, the entire groupby aggregation is done in C plugin | ||||
|    - If not, group by is done in SQL | ||||
| 
 | ||||
| ## 2. ColRef supports multiple objects | ||||
|    - A.a = B.b then in projection A.a B.b will refer to same projection | ||||
|    - Colref::ProjEq(ColRef v) => this == v or v in this.proj_eqs | ||||
| @ -0,0 +1,12 @@ | ||||
| #include "../server/libaquery.h" | ||||
| 
 | ||||
| 
 | ||||
| extern void* Aalloc(size_t sz); | ||||
| extern int Afree(void * mem); | ||||
| 
 | ||||
| template <typename T> | ||||
| size_t register_memory(T* ptr){ | ||||
|     [](void* m){ auto _m = static_cast<T*>(m); delete _m; }; | ||||
| } | ||||
| 
 | ||||
| #define EXPORT __DLLEXPORT__ | ||||
| @ -0,0 +1,5 @@ | ||||
| #include "aquery.h" | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <stdlib> | ||||
| 
 | ||||
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								| @ -1,2 +0,0 @@ | ||||
| #TargetFrameworkVersion=:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.19041.0 | ||||
| Release|Win32|d:\gg\AQuery++\server\| | ||||
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								
											
												Binary file not shown.
											
										
									
								| @ -0,0 +1,14 @@ | ||||
| AGGREGATION FUNCTION covariances(x, y, w){ | ||||
|     static xmeans := 0., ymeans := 0., cnt := 0;  | ||||
|     if (cnt < w)  | ||||
|     {  | ||||
|         xmeans += x;  | ||||
|         ymeans += y;  | ||||
|         cnt+=1; | ||||
|     } | ||||
|     else {        | ||||
|         xmeans += (x - x.vec[cnt - w]) / w; | ||||
|         ymeans += (y - y.vec[cnt - w]) / w;    | ||||
|     } | ||||
|     avg (( x.vec(x.len-w, x.len) - xmeans ) * (y.vec(y.len - w, y.len) - ymeans )) | ||||
| } | ||||
| @ -0,0 +1,41 @@ | ||||
| AGGREGATION FUNCTION add(a, b){ | ||||
|     a+b | ||||
| } | ||||
| 
 | ||||
| AGGREGATION FUNCTION covariances2(x, y, w){ | ||||
|     xmeans := 0.; | ||||
|     ymeans := 0.; | ||||
|     l := _builtin_len; | ||||
| 
 | ||||
|     if (l > 0) | ||||
|     { | ||||
|         xmeans := x[0]; | ||||
|         ymeans := y[0]; | ||||
|         _builtin_ret[0] := 0.; | ||||
|     } | ||||
|     if (w > l) | ||||
|         w := l; | ||||
|     for (i := 1, j:= 0; i < w; i := i+1) { | ||||
|         xmeans += x[i];  | ||||
|         ymeans += y[i];  | ||||
|         _builtin_ret[i] := avg (( x(0, i) - xmeans/i ) * (y(0, i) - ymeans/i )); | ||||
|     } | ||||
|     xmeans /= w; | ||||
|     ymeans /= w; | ||||
|     for (i := w; i < l; i += 1)  | ||||
|     { | ||||
|         xmeans += (x[i] - x[i - w]) / w; | ||||
|         ymeans += (y[i] - y[i - w]) / w;    | ||||
|         _builtin_ret[i] := avg (( x(i-w, i) - xmeans ) * (y(i - w, i) - ymeans )); | ||||
|     } | ||||
|     Null | ||||
| } | ||||
| 
 | ||||
| CREATE TABLE test(a INT, b INT, c INT, d INT) | ||||
| 
 | ||||
| LOAD DATA INFILE "test.csv" | ||||
| INTO TABLE test | ||||
| FIELDS TERMINATED BY "," | ||||
| 
 | ||||
| select covariances2(a, b, 4) from test group by c; | ||||
| 
 | ||||
| @ -0,0 +1,32 @@ | ||||
| AGGREGATION FUNCTION covariances2(x, y, w){ | ||||
|     xmeans := 0.; | ||||
|     ymeans := 0.; | ||||
|     l := _builtin_len; | ||||
|     if (w > l) | ||||
|         w := l; | ||||
|     elif (w > l + 2) | ||||
|     { | ||||
|         l := 3; | ||||
|         w := 4; | ||||
|     } | ||||
|     elif(w < 99){ | ||||
|         l := 8; | ||||
|     } | ||||
|     elif(w<999) | ||||
|         w := 6; | ||||
|     else | ||||
|         l := l / 2; | ||||
| 
 | ||||
|     for (i := 0, j:= 0; i < w; i := i+1) { | ||||
|         xmeans += x[i];  | ||||
|         ymeans += y[i];  | ||||
|         _builtin_ret[i] := avg (( x(l-w, l) - xmeans ) * (y(l - w, l) - ymeans )); | ||||
|     } | ||||
|     for (i := 0; i < l; i += 1)  | ||||
|     { | ||||
|         xmeans += (x[i] - x[i - w]) / w; | ||||
|         ymeans += (y[i] - y[i - w]) / w;    | ||||
|         _builtin_ret[i] := avg (( x(l-w, l) - xmeans ) * (y(l - w, l) - ymeans )); | ||||
|     } | ||||
|     Null | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| #pragma once | ||||
| #include "./server/libaquery.h" | ||||
| #include "./server/aggregations.h" | ||||
| 
 | ||||
| auto covariances = [](auto x, auto y, auto w) { | ||||
| 	static auto xmeans=0.0;static auto ymeans=0.0; static auto cnt=0; | ||||
| 	auto reset = [=]() { xmeans=0.0, ymeans=0.0, cnt=0; };	 | ||||
| 	auto call = [](decltype(x) x, decltype(y) y, decltype(w) w){   | ||||
| 		if((cnt < w)) {			 | ||||
| 			xmeans += x; | ||||
| 			ymeans += y; | ||||
| 			cnt += 1; | ||||
| 		} | ||||
| 		y = (x - xmeans); | ||||
| 		return avg(((x.subvec((x - w), x) - xmeans) * (y.subvec((y - w), y) - ymeans)));	 | ||||
| 	}; | ||||
| 	return std::make_pair(reset, call); | ||||
| }; | ||||
| 
 | ||||
| @ -0,0 +1,14 @@ | ||||
| #include "udf.hpp" | ||||
| 
 | ||||
| int main(){ | ||||
|     vector_type _a{1,2,3,4}; | ||||
|     vector_type _b{2,3,3,5}; | ||||
|     ColRef<int> a("a"); | ||||
|     ColRef<int> b("b"); | ||||
|     a.initfrom(_a, "a"); | ||||
|     b.initfrom(_b, "b"); | ||||
|     ColRef<decltype(covariances2_gettype(a,b,0))> ret{4}; | ||||
|     covariances2(a,b,2,4,ret); | ||||
|      | ||||
|     print(ret); | ||||
| } | ||||
| @ -0,0 +1,5 @@ | ||||
| #include "udf.hpp" | ||||
| 
 | ||||
| int main(){ | ||||
| 	  | ||||
| } | ||||
					Loading…
					
					
				
		Reference in new issue