MonetDB: default - Get rid of our copy of getopt. We haven't ac...
Changeset: 7e0c6072e63b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/7e0c6072e63b Removed Files: cmake/Modules/FindGetopt.cmake common/options/getopt.c common/options/getopt1.c common/options/monet_getopt.h Modified Files: clients/mapiclient/mclient.c clients/mapiclient/msqldump.c cmake/monetdb-defines.cmake common/options/CMakeLists.txt common/options/monet_options.c ctest/cmake/set-cmake-vars.cmake monetdb_config.h.in sql/server/sqlparse.c testing/listexports.py tools/mserver/mserver5.c Branch: default Log Message: Get rid of our copy of getopt. We haven't actually used it in years. diffs (truncated from 1559 to 300 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -18,12 +18,8 @@ */ #include "monetdb_config.h" -#ifndef HAVE_GETOPT_LONG -# include "monet_getopt.h" -#else -# ifdef HAVE_GETOPT_H -# include "getopt.h" -# endif +#ifdef HAVE_GETOPT_H +#include "getopt.h" #endif #include "stream.h" #include "mapi.h" diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c --- a/clients/mapiclient/msqldump.c +++ b/clients/mapiclient/msqldump.c @@ -11,12 +11,8 @@ */ #include "monetdb_config.h" -#ifndef HAVE_GETOPT_LONG -# include "monet_getopt.h" -#else -# ifdef HAVE_GETOPT_H -# include "getopt.h" -# endif +#ifdef HAVE_GETOPT_H +#include "getopt.h" #endif #include "mapi.h" #include diff --git a/cmake/Modules/FindGetopt.cmake b/cmake/Modules/FindGetopt.cmake deleted file mode 100644 --- a/cmake/Modules/FindGetopt.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# - Find Getopt -# Find the native getopt headers and libraries. -# -# GETOPT_INCLUDE_DIR - where to find getopt.h, etc. -# GETOPT_LIBRARIES - List of libraries when using getopt. -# GETOPT_FOUND - True if getopt found. - -##find_path(HAVE_GETOPT_H "getopt.h") -##check_symbol_exists("getopt_long" "getopt.h" HAVE_GETOPT_LONG) - -##find_library(GETOPT_LIB "getopt.lib") -#cmakedefine HAVE_GETOPT_H @HAVE_GETOPT_H@ -#cmakedefine HAVE_GETOPT_LONG @HAVE_GETOPT_LONG@ - -#define HAVE_GETOPT_LONG 1 -#cmakedefine HAVE_GETOPT_H @HAVE_GETOPT_H@ -#cmakedefine GETOPT_LIB @GETOPT_LIB@ diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -74,10 +74,6 @@ function(monetdb_configure_defines) check_function_exists("getentropy" HAVE_GETENTROPY) check_function_exists("getexecname" HAVE_GETEXECNAME) check_function_exists("getlogin" HAVE_GETLOGIN) - cmake_push_check_state() -set(CMAKE_REQUIRED_INCLUDES "${HAVE_GETOPT_H}") -check_symbol_exists("getopt_long" "getopt.h" HAVE_GETOPT_LONG) - cmake_pop_check_state() check_function_exists("getrlimit" HAVE_GETRLIMIT) check_function_exists("gettid" HAVE_GETTID) check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) @@ -175,9 +171,6 @@ macro(monetdb_macro_variables) CACHE INTERNAL "C udfs extension is available") - if(HAVE_GETOPT_H) -set(HAVE_GETOPT 1) - endif() # compiler options, profiling (google perf tools), valgrind # Check that posix regex is available when pcre is not found # "monetdb5/module/mal/pcre.c" assumes the regex library is available diff --git a/common/options/CMakeLists.txt b/common/options/CMakeLists.txt --- a/common/options/CMakeLists.txt +++ b/common/options/CMakeLists.txt @@ -11,8 +11,7 @@ #]] set(moptions_public_headers - ${CMAKE_CURRENT_SOURCE_DIR}/monet_options.h - ${CMAKE_CURRENT_SOURCE_DIR}/monet_getopt.h) + ${CMAKE_CURRENT_SOURCE_DIR}/monet_options.h) add_library(moptions STATIC) @@ -24,16 +23,13 @@ target_sources(moptions ${moptions_public_headers}) target_include_directories(moptions - PRIVATE - $<$:${HAVE_GETOPT_H}> PUBLIC $ $) target_link_libraries(moptions PRIVATE - monetdb_config_header - $<$:${GETOPT_LIB}>) + monetdb_config_header) if(NOT MONETDB_STATIC) set_target_properties(moptions @@ -44,7 +40,6 @@ endif() install(FILES monet_options.h - monet_getopt.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb COMPONENT monetdbdev) diff --git a/common/options/getopt.c b/common/options/getopt.c deleted file mode 100644 --- a/common/options/getopt.c +++ /dev/null @@ -1,941 +0,0 @@ -/* - * SPDX-License-Identifier: MPL-2.0 - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Copyright 2024, 2025 MonetDB Foundation; - * Copyright August 2008 - 2023 MonetDB B.V.; - * Copyright 1997 - July 2008 CWI. - */ - -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drep...@gnu.org - before changing it! -
MonetDB: nested - pass multiset info to result set
Changeset: 29eb4f7ce81f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/29eb4f7ce81f Modified Files: clients/Tests/MAL-signatures-hge.test clients/Tests/exports.stable.out sql/backends/monet5/sql.c sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_result.c sql/backends/monet5/sql_result.h sql/backends/monet5/sql_statement.c sql/storage/bat/bat_table.c sql/storage/bat/res_table.c sql/storage/sql_storage.h sql/test/SQLancer/Tests/sqlancer10.test tools/monetdbe/monetdbe.c Branch: nested Log Message: pass multiset info to result set diffs (truncated from 599 to 300 lines): diff --git a/clients/Tests/MAL-signatures-hge.test b/clients/Tests/MAL-signatures-hge.test --- a/clients/Tests/MAL-signatures-hge.test +++ b/clients/Tests/MAL-signatures-hge.test @@ -46409,6 +46409,11 @@ pattern json.dump(X_0:json):bat[:str] JSONdump (empty) json +epilogue +command json.epilogue():void +JSONepilogue +(empty) +json filter command json.filter(X_0:json, X_1:str):json JSONfilter @@ -46524,6 +46529,16 @@ command json.number(X_0:json):dbl JSONjson2number Convert simple JSON values to a double, return nil upon error. json +prelude +pattern json.prelude():void +JSONprelude +(empty) +json +read_json +pattern json.read_json(X_0:str):bat[:json] +JSONread_json +Reads json file into a table +json renderarray pattern json.renderarray(X_0:any...):json JSONrenderarray @@ -49145,7 +49160,7 @@ SQLfirst_value return the first value of groups sql from_json -pattern sql.from_json(X_0:json, X_1:ptr):bat[:any]... +pattern sql.from_json(X_0:bat?[:json], X_1:ptr):bat[:any]... SQLfrom_json Reads json string into table of nested/multiset structures sql @@ -49455,20 +49470,20 @@ mvc_restart_seq restart the sequence with value start sql resultSet -unsafe pattern sql.resultSet(X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:int], X_4:bat[:int], X_5:any...):int +unsafe pattern sql.resultSet(X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:int], X_4:bat[:int], X_5:bat[:int], X_6:bat[:any]...):int +mvc_result_set_wrap +Prepare a table result set for the client in default CSV format +sql +resultSet +unsafe pattern sql.resultSet(X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:int], X_4:bat[:int], X_5:bat[:int], X_6:any...):int mvc_row_result_wrap Prepare a table result set for the client front-end sql resultSet -unsafe pattern sql.resultSet(X_0:str, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, X_6:any):int +unsafe pattern sql.resultSet(X_0:str, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, X_6:int, X_7:any):int mvc_scalar_value_wrap Prepare a table result set for the client front-end. sql -resultSet -unsafe pattern sql.resultSet(X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:int], X_4:bat[:int], X_5:bat[:any]...):int -mvc_table_result_wrap -Prepare a table result set for the client in default CSV format -sql resume_log_flushing unsafe pattern sql.resume_log_flushing():void SQLresume_log_flushing diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1633,7 +1633,7 @@ str mvc_commit(mvc *c, int chain, const int mvc_create_column(sql_column **col, mvc *m, sql_table *t, const char *name, sql_subtype *tpe); int mvc_create_table(sql_table **t, mvc *m, sql_schema *s, const char *name, int tt, bit system, int persistence, int commit_action, int sz, bit properties); void mvc_query_processed(mvc *m); -int mvc_result_column(backend *be, const char *tn, const char *name, const char *typename, int digits, int scale, BAT *b); +int mvc_result_column(backend *be, const char *tn, const char *name, const char *typename, int digits, int scale, int multiset, BAT *b); int mvc_result_table(backend *be, oid query_id, int nr_cols, mapi_query_t type); str mvc_rollback(mvc *c, int chain, const char *name, bool disabling_auto_commit); str number2name(str s, int len, int i); diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c --- a/sql/backends/monet5/sql.c +++ b/sql/backends/monet5/sql.c @@ -2548,7 +2548,7 @@ SQLtid(Client cntxt, MalBlkPtr mb, MalSt return msg; } -/* unsafe pattern resultSet(tbl:bat[:str], attr:bat[:str], tpe:bat[:str], len:bat[:int],scale:bat[:int], cols:bat[:any]...) :int */ +/* unsafe pattern resultSet(tbl:bat[:str], attr:bat[:str], tpe:bat[:str], len:bat[:int],scale:bat[:int],multiset:bat[:int], cols:bat[:any]...) :int */ /* New result set rendering infrastructure */ static str @@ -2560,15 +2560,16 @@ mvc_result_set_wrap( Client cntxt, MalBl bat tpeId= *getArgReference_bat(stk, pci,3); bat lenId= *getArgReference_bat(stk, pci,4); bat scaleId= *getArgReference_bat(stk, pci,5); + bat multisetId= *getArgReference_bat(stk, pci,6); bat bid; int i, res, ok; const char *tblname, *colname, *tpen
MonetDB: default - Merge with Aug2024 branch.
Changeset: 84d5efb137b6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/84d5efb137b6 Branch: default Log Message: Merge with Aug2024 branch. diffs (27 lines): diff --git a/sql/test/sysmon/Tests/sys_user_statistics.SQL.py b/sql/test/sysmon/Tests/sys_user_statistics.SQL.py --- a/sql/test/sysmon/Tests/sys_user_statistics.SQL.py +++ b/sql/test/sysmon/Tests/sys_user_statistics.SQL.py @@ -20,17 +20,16 @@ with SQLTestCase() as mdb: with SQLTestCase() as usr: usr.connect(username=u, password=u) usr.execute('select current_user as myname').assertSucceeded() -usr.execute('call sys.sleep('+SLEEP_TIME+')').assertSucceeded() +usr.execute(f'call sys.sleep({SLEEP_TIME})').assertSucceeded() # now check user_statistics again -rowcnt = mdb.execute('select username, querycount, maxquery from sys.user_statistics() where username like \'user%\' order by username;').assertSucceeded().\ +rowcnt = mdb.execute('select username, maxquery from sys.user_statistics() where username like \'user%\' order by username;').assertSucceeded().\ assertDataResultMatch([ -('user1', 2, 'call sys.sleep('+SLEEP_TIME+')\n;'), -('user2', 2, 'call sys.sleep('+SLEEP_TIME+')\n;'), -('user3', 2, 'call sys.sleep('+SLEEP_TIME+')\n;'), -('user4', 2, 'call sys.sleep('+SLEEP_TIME+')\n;') +('user1', f'call sys.sleep({SLEEP_TIME})\n;'), +('user2', f'call sys.sleep({SLEEP_TIME})\n;'), +('user3', f'call sys.sleep({SLEEP_TIME})\n;'), +('user4', f'call sys.sleep({SLEEP_TIME})\n;') ]) for u in users: mdb.execute('drop user {u};'.format(u=u)).assertSucceeded() mdb.execute('drop procedure sleep;').assertSucceeded() - ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Aug2024 - Fix test: don't test number of queries since ...
Changeset: b7bee6cd0fc9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b7bee6cd0fc9 Modified Files: sql/test/sysmon/Tests/sys_user_statistics.SQL.py Branch: Aug2024 Log Message: Fix test: don't test number of queries since preparation may differ. diffs (27 lines): diff --git a/sql/test/sysmon/Tests/sys_user_statistics.SQL.py b/sql/test/sysmon/Tests/sys_user_statistics.SQL.py --- a/sql/test/sysmon/Tests/sys_user_statistics.SQL.py +++ b/sql/test/sysmon/Tests/sys_user_statistics.SQL.py @@ -20,17 +20,16 @@ with SQLTestCase() as mdb: with SQLTestCase() as usr: usr.connect(username=u, password=u) usr.execute('select current_user as myname').assertSucceeded() -usr.execute('call sys.sleep('+SLEEP_TIME+')').assertSucceeded() +usr.execute(f'call sys.sleep({SLEEP_TIME})').assertSucceeded() # now check user_statistics again -rowcnt = mdb.execute('select username, querycount, maxquery from sys.user_statistics() where username like \'user%\' order by username;').assertSucceeded().\ +rowcnt = mdb.execute('select username, maxquery from sys.user_statistics() where username like \'user%\' order by username;').assertSucceeded().\ assertDataResultMatch([ -('user1', 2, 'call sys.sleep('+SLEEP_TIME+')\n;'), -('user2', 2, 'call sys.sleep('+SLEEP_TIME+')\n;'), -('user3', 2, 'call sys.sleep('+SLEEP_TIME+')\n;'), -('user4', 2, 'call sys.sleep('+SLEEP_TIME+')\n;') +('user1', f'call sys.sleep({SLEEP_TIME})\n;'), +('user2', f'call sys.sleep({SLEEP_TIME})\n;'), +('user3', f'call sys.sleep({SLEEP_TIME})\n;'), +('user4', f'call sys.sleep({SLEEP_TIME})\n;') ]) for u in users: mdb.execute('drop user {u};'.format(u=u)).assertSucceeded() mdb.execute('drop procedure sleep;').assertSucceeded() - ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: nested - add test
Changeset: 621bc1982190 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/621bc1982190 Added Files: sql/test/nested/Tests/webclicks.test Branch: nested Log Message: add test diffs (20 lines): diff --git a/sql/test/nested/Tests/webclicks.test b/sql/test/nested/Tests/webclicks.test new file mode 100644 --- /dev/null +++ b/sql/test/nested/Tests/webclicks.test @@ -0,0 +1,15 @@ +statement ok +create type kv as (key varchar, value varchar) + +statement ok +create type loc as (list kv[]) + +statement ok +create type event as (id int , type varchar, location loc) + +statement ok +create table events(ev event[]) + +statement ok +insert into events values (array[(1, "click", array[("hostname", "localhost")])]) + ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Attempt to find getopt on Windows.
Changeset: b64b91173af5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b64b91173af5 Modified Files: sql/server/CMakeLists.txt Branch: default Log Message: Attempt to find getopt on Windows. diffs (21 lines): diff --git a/sql/server/CMakeLists.txt b/sql/server/CMakeLists.txt --- a/sql/server/CMakeLists.txt +++ b/sql/server/CMakeLists.txt @@ -145,6 +145,7 @@ target_include_directories(sqlparserlib $ $ $ + $<$:${HAVE_GETOPT_H}> PUBLIC $ $) @@ -155,7 +156,8 @@ target_link_libraries(sqlparserlib bat sqlcommon sqlinclude - sqlstorage) + sqlstorage + $<$:${GETOPT_LIB}>) target_compile_definitions(sqlparserlib PRIVATE ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - try including getopt.h like mclient
Changeset: 9754cf13d9ca for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/9754cf13d9ca Modified Files: sql/server/CMakeLists.txt Branch: default Log Message: try including getopt.h like mclient diffs (29 lines): diff --git a/sql/server/CMakeLists.txt b/sql/server/CMakeLists.txt --- a/sql/server/CMakeLists.txt +++ b/sql/server/CMakeLists.txt @@ -145,7 +145,6 @@ target_include_directories(sqlparserlib $ $ $ - $<$:${HAVE_GETOPT_H}> PUBLIC $ $) @@ -156,8 +155,7 @@ target_link_libraries(sqlparserlib bat sqlcommon sqlinclude - sqlstorage - $<$:${GETOPT_LIB}>) + sqlstorage) target_compile_definitions(sqlparserlib PRIVATE @@ -179,6 +177,7 @@ target_sources(sqlparse target_include_directories(sqlparse PRIVATE + $<$:${HAVE_GETOPT_H}> $ PUBLIC $ ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: nested - wip
Changeset: 36cdcb642edc for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/36cdcb642edc Modified Files: sql/backends/monet5/sql.c Branch: nested Log Message: wip diffs (88 lines): diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c --- a/sql/backends/monet5/sql.c +++ b/sql/backends/monet5/sql.c @@ -5820,6 +5820,21 @@ insert_json_array(char **msg, JSON *js, } static str +insert_json_str(const char *jstr, BAT **bats, int cnt, sql_subtype *t) +{ + char *res = MAL_SUCCEED; + JSON *js = JSONparse(jstr); + if (!js) + throw(SQL, "insert_json_str", "JSONparse error"); + if (t->multiset) + (void)insert_json_array(&res, js, bats, cnt, 0, 1, 1, t); + else + (void)insert_json_object(&res, js, bats, cnt, 0, 1, 1, t); + JSONfree(js); + return res; +} + +static str SQLfrom_json(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) { str msg = NULL; @@ -5830,6 +5845,18 @@ SQLfrom_json(Client cntxt, MalBlkPtr mb, if ((msg = checkSQLContext(cntxt)) != NULL) return msg; int mtype = getArgType(mb, pci, pci->retc); + sql_subtype *t = *(sql_subtype**)getArgReference(stk, pci, pci->retc+1); + + BAT **bats = (BAT**)GDKzalloc(sizeof(BAT*) * pci->retc); + if (!bats) + throw(SQL, "SQLfrom_json", SQLSTATE(HY013) MAL_MALLOC_FAIL); + for(int i = 0; i < pci->retc; i++) { + bats[i] = COLnew(0, getBatType(getArgType(mb, pci, i)), 10, TRANSIENT); + if (!bats[i]) + goto bailout; + } + + (void)m; if (isaBatType(mtype)) { if(strcmp(BATatoms[getBatType(mtype)].name, "json") != 0 ) @@ -5840,38 +5867,18 @@ SQLfrom_json(Client cntxt, MalBlkPtr mb, BUN p, q; BATloop(b, p, q) { const char *json = (const char *) BUNtail(bi, p); - (void) json; + if ((msg = insert_json_str(json, bats, pci->retc, t )) != MAL_SUCCEED) + goto bailout; } bat_iterator_end(&bi); } else { if (strcmp(BATatoms[mtype].name, "json") != 0) throw(SQL, "SQLfrom_json", SQLSTATE(HY013) "Incorrect argument type"); - } - - str json = *(str*)getArgReference(stk, pci, pci->retc); - sql_subtype *t = *(sql_subtype**)getArgReference(stk, pci, pci->retc+1); - - BAT **bats = (BAT**)GDKzalloc(sizeof(BAT*) * pci->retc); - if (!bats) - throw(SQL, "SQLfrom_json", SQLSTATE(HY013) MAL_MALLOC_FAIL); - for(int i = 0; i < pci->retc; i++) { - bats[i] = COLnew(0, getBatType(getArgType(mb, pci, i)), 10, TRANSIENT); - if (!bats[i]) + str json = *(str*)getArgReference(stk, pci, pci->retc); + if ((msg = insert_json_str(json, bats, pci->retc, t )) != MAL_SUCCEED) goto bailout; } - (void)m; - - JSON *js = JSONparse(json); - if (!js) /* TODO output parser error ?? */ - goto bailout; - - if (t->multiset) - (void)insert_json_array(&msg, js, bats, pci->retc, 0, 1, 1, t); - else - (void)insert_json_object(&msg, js, bats, pci->retc, 0, 1, 1, t); - JSONfree(js); - if (msg) - goto bailout; + for(int i = 0; i < pci->retc && bats[i]; i++) { *getArgReference_bat(stk, pci, i) = bats[i]->batCacheid; BBPkeepref(bats[i]); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Aug2024 - JDBC driver now has a two digit major version.
Changeset: b3eb52bd5490 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b3eb52bd5490 Modified Files: testing/Mtest.py.in Branch: Aug2024 Log Message: JDBC driver now has a two digit major version. diffs (12 lines): diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -3146,7 +3146,7 @@ def CheckClassPath() : cp = '' cpx = '' JARS = { -'HAVE_MONETDBJDBC_JAR' : re.compile(r'^monetdb-jdbc-[0-9]\.[0-9]+(-[a-f0-9]{12})?\.jre[0-9]+\.jar$'), +'HAVE_MONETDBJDBC_JAR' : re.compile(r'^monetdb-jdbc-[0-9][0-9]?\.[0-9]+(-[a-f0-9]{12})?\.jre[0-9]+\.jar$'), 'HAVE_JDBCCLIENT_JAR' : re.compile(r'^jdbcclient\.jre[0-9]+\.jar$'), 'HAVE_JDBCTESTS_JAR' : re.compile(r'^jdbctests\.jar$'), } ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merge with Aug2024 branch.
Changeset: e628d76163ee for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e628d76163ee Modified Files: testing/Mtest.py.in Branch: default Log Message: Merge with Aug2024 branch. diffs (12 lines): diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -3212,7 +3212,7 @@ def CheckClassPath() : cp = '' cpx = '' JARS = { -'HAVE_MONETDBJDBC_JAR' : re.compile(r'^monetdb-jdbc-[0-9]\.[0-9]+(-[a-f0-9]{12})?\.jre[0-9]+\.jar$'), +'HAVE_MONETDBJDBC_JAR' : re.compile(r'^monetdb-jdbc-[0-9][0-9]?\.[0-9]+(-[a-f0-9]{12})?\.jre[0-9]+\.jar$'), 'HAVE_JDBCCLIENT_JAR' : re.compile(r'^jdbcclient\.jre[0-9]+\.jar$'), 'HAVE_JDBCTESTS_JAR' : re.compile(r'^jdbctests\.jar$'), } ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: const_aggr_elim - rel_const_aggr_remove now handles sum...
Changeset: c5da96e23778 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/c5da96e23778 Modified Files: sql/server/rel_optimize_proj.c Branch: const_aggr_elim Log Message: rel_const_aggr_remove now handles sum prod cnt cases diffs (75 lines): diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c --- a/sql/server/rel_optimize_proj.c +++ b/sql/server/rel_optimize_proj.c @@ -2518,18 +2518,65 @@ rel_remove_const_aggr(visitor *v, sql_re for(node *n = exps->h; n; n = n->next) { sql_exp *e = n->data; - if(e->type == e_aggr && - !((sql_subfunc *)e->f)->func->s && - strcmp(((sql_subfunc *)e->f)->func->base.name, "count") != 0 && - strcmp(((sql_subfunc *)e->f)->func->base.name, "sum") != 0 && - ((sql_subfunc *)e->f)->func->system == 1 - ) { + if(e->type != e_aggr) { + continue; + } + + sql_func *j = ((sql_subfunc *)e->f)->func; + + int sum = strcmp(j->base.name, "sum") == 0, + prd = strcmp(j->base.name, "prod") == 0, + cnt = strcmp(j->base.name, "count") == 0; + + if(!j->s && j->system == 1) { // && !cnt list *se = e->l; + if(se == NULL) { + continue; + } + for(node *m = se->h; m; m = m->next) { sql_exp *w = m->data; if(w->type == e_atom && w->card == CARD_ATOM) { + if(sum && !(((atom*)w->l)->isnull || atom_is_zero((atom*)w->l))) { + continue; + } + + if(prd && !(((atom*)w->l)->isnull || ((atom*)w->l)->data.val.lval == 1)) { + continue; + } + + /*if(cnt && ((atom*)w->l)->isnull) { // && 0 + list_remove_node(se, NULL, m); + sql_exp *rr=exp_atom_lng(v->sql->sa, 0); + list_append(se, rr); + + + exp_setalias(rr,e->alias.label,e->alias.rname,e->alias.name); + n->data = rr; + + v->changes++; + + continue; + } + else if(cnt) { + continue; + }*/ + + /* Handle: select count(distinct NULL) + 3 == 3 */ + if(cnt) { + if(((atom*)w->l)->isnull) { + list_remove_node(se, NULL, m); + + w=exp_atom_lng(v->sql->sa, 0); + list_append(se, w); + } + else { + continue; + } + } + exp_setalias(w,e->alias.label,e->alias.rname,e->alias.name); n->data = w; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org