Changeset: 3b15afba4e29 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3b15afba4e29
Added Files:
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_00.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_01.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_02.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_03.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_04.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_05.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_06.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_07.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_09.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_10.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_11.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_12.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_13.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_15.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_16.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_17.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_18.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_19.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_20.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_21.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_23.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_24.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_25.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_26.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_27.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_28.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_29.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_30.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_31.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_32.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_01.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_02.sql.src
        sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_05.sql.src
        
sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.SQL.bat
        
sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.SQL.sh
        
sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.stable.err
        
sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.stable.out
        
sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.sql
        
sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err
        
sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.out
        sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128.src
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit.src
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128.src
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.src
        sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128.src
        sql/test/emptydb-upgrade/Tests/check.stable.out.32bit.src
        sql/test/emptydb-upgrade/Tests/check.stable.out.int128.src
        sql/test/emptydb-upgrade/Tests/check.stable.out.src
Removed Files:
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_00.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_01.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_02.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_03.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_04.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_05.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_06.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_07.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_09.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_10.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_11.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_12.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_13.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_15.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_16.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_17.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_18.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_19.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_20.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_21.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_23.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_24.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_25.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_26.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_27.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_28.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_29.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_30.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_31.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_32.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_01.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_02.SQL.sh
        sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_05.SQL.sh
        sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade/Tests/check.stable.out
        sql/test/emptydb-upgrade/Tests/check.stable.out.32bit
        sql/test/emptydb-upgrade/Tests/check.stable.out.int128
        sql/test/emptydb/updatetests
Modified Files:
        ChangeLog
        MonetDB.spec
        NT/rules.msc
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        clients/mapilib/mapi.c
        clients/odbc/driver/ODBCDesc.c
        clients/odbc/driver/ODBCUtil.c
        common/stream/ChangeLog
        common/stream/stream.c
        common/stream/stream.h
        gdk/gdk_bbp.c
        gdk/gdk_interprocess.c
        gdk/gdk_ssort.c
        monetdb5/ChangeLog
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_exception.c
        monetdb5/mal/mal_exception.h
        monetdb5/mal/mal_import.c
        monetdb5/modules/atoms/streams.c
        monetdb5/modules/atoms/streams.h
        monetdb5/modules/atoms/streams.mal
        monetdb5/optimizer/Tests/DCexample2.malC
        monetdb5/optimizer/Tests/DCexample2.stable.out
        monetdb5/optimizer/Tests/GCexample01.stable.out
        monetdb5/optimizer/Tests/dataflow.stable.out
        monetdb5/optimizer/Tests/dataflow3.malC
        monetdb5/optimizer/Tests/dataflow3.stable.out
        monetdb5/optimizer/opt_deadcode.c
        monetdb5/optimizer/opt_emptybind.c
        monetdb5/optimizer/opt_evaluate.c
        monetdb5/optimizer/opt_garbageCollector.c
        monetdb5/optimizer/opt_matpack.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_profiler.c
        monetdb5/optimizer/opt_support.c
        sql/ChangeLog
        sql/backends/monet5/Tests/int_notation_1e5.stable.out.int128
        sql/backends/monet5/Tests/pyapi02.stable.out
        sql/backends/monet5/Tests/pyapi04.stable.out
        sql/backends/monet5/Tests/pyapi06.stable.out
        sql/backends/monet5/Tests/pyapi07.stable.out
        sql/backends/monet5/Tests/pyapi08.stable.out
        sql/backends/monet5/Tests/pyapi09.stable.err
        sql/backends/monet5/Tests/pyapi09.stable.out
        sql/backends/monet5/Tests/pyapi10.stable.err
        sql/backends/monet5/Tests/pyapi10.stable.err.Windows
        sql/backends/monet5/Tests/pyapi11.stable.out
        sql/backends/monet5/Tests/pyapi12.stable.out
        sql/backends/monet5/Tests/pyapi13.stable.out
        sql/backends/monet5/Tests/pyapi14.stable.out
        sql/backends/monet5/Tests/pyapi16.stable.out
        sql/backends/monet5/Tests/pyapi17.stable.err
        sql/backends/monet5/Tests/pyapi17.stable.out
        sql/backends/monet5/Tests/pyapi19.stable.err
        sql/backends/monet5/Tests/pyapi20.stable.err
        sql/backends/monet5/Tests/pyapi21.stable.out
        sql/backends/monet5/Tests/pyapi23.stable.out
        sql/backends/monet5/Tests/pyapi24.stable.out
        sql/backends/monet5/Tests/pyapi25.stable.err
        sql/backends/monet5/Tests/pyapi25.stable.err.Windows
        sql/backends/monet5/Tests/pyapi26.stable.out
        sql/backends/monet5/Tests/pyapi27.stable.out
        sql/backends/monet5/Tests/pyapi28.stable.out
        sql/backends/monet5/Tests/pyapi29.stable.err
        sql/backends/monet5/Tests/pyapi30.stable.out
        sql/backends/monet5/Tests/pyapi32.stable.out
        sql/backends/monet5/Tests/pyloader03.stable.err
        sql/backends/monet5/Tests/pyloader04.stable.err
        sql/backends/monet5/Tests/pyloader06.stable.err
        sql/backends/monet5/Tests/rapi02.stable.out
        sql/backends/monet5/Tests/rapi06.stable.out
        sql/backends/monet5/Tests/rapi07.stable.out
        sql/backends/monet5/Tests/rapi09.stable.out
        sql/backends/monet5/Tests/rapi10.stable.out
        sql/backends/monet5/Tests/rapi12.stable.out
        sql/backends/monet5/Tests/rapi13.stable.out
        sql/backends/monet5/Tests/rapi14.stable.out
        sql/backends/monet5/Tests/rapi15.stable.out
        sql/backends/monet5/Tests/rapi16.stable.out
        sql/backends/monet5/Tests/rapi17.stable.out
        sql/backends/monet5/Tests/rapi18.stable.out
        sql/backends/monet5/Tests/rapi19.stable.out
        sql/backends/monet5/Tests/rapi20.stable.out
        sql/backends/monet5/UDF/pyapi/connection.c
        sql/backends/monet5/UDF/pyapi/conversion.c
        sql/backends/monet5/UDF/pyapi/convert_loops.h
        sql/backends/monet5/UDF/pyapi/emit.c
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_09.stable.err
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_10.stable.err
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_17.stable.err
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_19.stable.err
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_20.stable.err
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_25.stable.err
        sql/backends/monet5/UDF/pyapi3/Tests/pyapi3_29.stable.err
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statement.c
        sql/backends/monet5/vaults/bam/bam_globals.c
        sql/benchmarks/tpch/fileleak/Tests/check1.stable.out
        sql/benchmarks/tpch/fileleak/Tests/delete_all.stable.out
        sql/benchmarks/tpch/fileleak/Tests/leaks.stable.out
        sql/benchmarks/tpch/fileleak/Tests/leaks.stable.out.Windows
        sql/benchmarks/tpch/fileleak/Tests/load.stable.out
        sql/benchmarks/tpch/load.sh
        sql/common/sql_list.c
        sql/common/sql_types.c
        sql/jdbc/tests/Tests/All
        sql/server/rel_dump.c
        sql/server/rel_psm.c
        sql/server/rel_select.c
        sql/server/sql_parser.y
        sql/storage/bat/bat_storage.c
        
sql/test/BugDay_2005-11-09_2.9.3/Tests/history_table_escape.SF-1072089.stable.err
        sql/test/BugTracker-2009/Tests/drop-sequence-crash.SF-2854195.stable.err
        sql/test/BugTracker-2009/Tests/rollback_bug.stable.err
        sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err
        sql/test/BugTracker-2010/Tests/join_problem.Bug-2694.sql
        sql/test/BugTracker-2010/Tests/join_problem.Bug-2694.stable.out
        
sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.stable.err
        
sql/test/BugTracker-2012/Tests/name_resolution_in_proc.Bug-3074.stable.err
        
sql/test/BugTracker-2013/Tests/cannot_use_columns_after_groupby.Bug-3340.stable.err
        sql/test/BugTracker-2015/Tests/duplicate-constraint.Bug-3820.stable.err
        
sql/test/BugTracker-2015/Tests/local-remotetable-crash.Bug-3754.stable.err
        sql/test/BugTracker-2015/Tests/with-columns-mismatch.Bug-3697.stable.err
        sql/test/BugTracker-2016/Tests/merge-table-edit.Bug-6084.stable.err
        sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.err
        sql/test/BugTracker-2017/Tests/All
        sql/test/BugTracker-2017/Tests/exist-bigint-missing.Bug-6315.stable.err
        
sql/test/BugTracker-2017/Tests/extract_quarter_week_from_date.Bug-3831.sql
        
sql/test/BugTracker-2017/Tests/extract_quarter_week_from_date.Bug-3831.stable.out
        sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql
        sql/test/BugTracker/Tests/broken_join.SF-1373391.stable.err
        sql/test/BugTracker/Tests/crash_on_fkey_update2.SF-1703497.stable.err
        sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
        sql/test/BugTracker/Tests/insert_values.SF-1578838.stable.err
        sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
        sql/test/BugTracker/Tests/set_operation_coersions.SF-1543216.stable.err
        sql/test/Tests/systemfunctions.stable.out
        sql/test/Tests/systemfunctions.stable.out.int128
        sql/test/Users/Tests/role2.stable.err
        sql/test/Users/Tests/test_privs2_p2.stable.err
        sql/test/Users/Tests/test_privs_p2.stable.err
        sql/test/bugs/Tests/profile_bug-SF.1314649.stable.err
        sql/test/bugs/Tests/savepoint_rollback-bug-sf-953553.stable.err
        sql/test/bugs/Tests/unique-bug-sf-1043512.stable.err
        sql/test/copy/Tests/nonutf8.stable.err
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/emptydb/Tests/check.stable.out.int128
        sql/test/leaks/Tests/check1.stable.out
        sql/test/leaks/Tests/check1.stable.out.int128
        sql/test/leaks/Tests/check2.stable.out
        sql/test/leaks/Tests/check2.stable.out.int128
        sql/test/leaks/Tests/check3.stable.out
        sql/test/leaks/Tests/check3.stable.out.int128
        sql/test/leaks/Tests/check4.stable.out
        sql/test/leaks/Tests/check4.stable.out.int128
        sql/test/leaks/Tests/check5.stable.out
        sql/test/leaks/Tests/check5.stable.out.int128
        sql/test/leaks/Tests/select1.stable.out
        sql/test/leaks/Tests/select1.stable.out.int128
        sql/test/leaks/Tests/select2.stable.out
        sql/test/leaks/Tests/select2.stable.out.int128
        sql/test/leaks/Tests/temp1.stable.out
        sql/test/mapi/Tests/perl_dbi.SQL.bat
        sql/test/mapi/Tests/python2_dbapi.stable.out
        sql/test/mapi/Tests/python3_dbapi.SQL.bat
        sql/test/mapi/Tests/python3_dbapi.stable.out
        sql/test/mapi/Tests/python3_dec38.SQL.bat
        sql/test/mapi/Tests/python3_int128.SQL.bat
        sql/test/mergetables/Tests/crash0.stable.err
        sql/test/mergetables/Tests/singlekeyconstraint.stable.err
        sql/test/pg_regress/Tests/date.sql
        sql/test/pg_regress/Tests/time.sql
        sql/test/pg_regress/Tests/time.stable.err
        sql/test/pg_regress/Tests/timestamp.sql
        sql/test/pg_regress/Tests/timestamp.stable.err
        sql/test/pg_regress/Tests/timestamptz.sql
        sql/test/pg_regress/Tests/timestamptz.stable.err
        sql/test/pg_regress/Tests/timetz.sql
        sql/test/pg_regress/Tests/timetz.stable.err
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
        testing/Mfilter.py
        testing/Mtest.py.in
        tools/merovingian/ChangeLog
        tools/merovingian/client/monetdb.1
        tools/merovingian/client/monetdb.c
        tools/merovingian/daemon/connections.c
        tools/merovingian/daemon/controlrunner.c
        tools/merovingian/daemon/forkmserver.c
        tools/merovingian/daemon/forkmserver.h
        tools/merovingian/utils/properties.h
        tools/merovingian/utils/utils.c
        tools/mserver/shutdowntest.c
Branch: comment-on
Log Message:

Merge 'default' into 'comment-on'


diffs (truncated from 95369 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,3 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
-* Thu Jul 20 2017 Martin van Dinther <[email protected]>
-- Added support for extracting the quarter (number between 1 and 4)
-  of a date (or timestamp or timestamp with timezone) in SQL:
-   EXTRACT ( QUARTER FROM my_date_expr ).
-  Added support for extracting the week (number between 1 and 53)
-  of a date (or timestamp or timestamp with timezone) in SQL:
-   EXTRACT ( WEEK FROM my_date_expr ).
-
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -139,7 +139,9 @@ Source: https://www.monetdb.org/download
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
 # RHEL >= 7, and all current Fedora
 BuildRequires: systemd
-BuildRequires: checkpolicy, selinux-policy-devel, hardlink
+BuildRequires: checkpolicy
+BuildRequires: selinux-policy-devel
+BuildRequires: hardlink
 %endif
 BuildRequires: bison
 BuildRequires: bzip2-devel
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -326,6 +326,11 @@ create_winconfig_conds_new_py:
 !ELSE
        $(ECHO) HAVE_LIBPY_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ENDIF
+!IFDEF HAVE_LIBPY3
+       $(ECHO) HAVE_LIBPY3_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
+!ELSE
+       $(ECHO) HAVE_LIBPY3_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
+!ENDIF
 !IFDEF HAVE_LIBR
        $(ECHO) HAVE_LIBR_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ELSE
diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -8543,17 +8543,11 @@ Ready.
 [ "streams",   "close",        "command streams.close(s:streams):void ",       
"mnstr_close_streamwrap;",      "close and destroy the stream s"        ]
 [ "streams",   "flush",        "command streams.flush(s:streams):void ",       
"mnstr_flush_streamwrap;",      "flush the stream"      ]
 [ "streams",   "openRead",     "command streams.openRead(filename:str):streams 
",      "mnstr_open_rastreamwrap;",     "open ascii file stream for reading"    
]
-[ "streams",   "openRead",     "command streams.openRead(s:streams):streams ", 
"mnstr_stream_rstreamwrap;",    "convert an ascii stream to binary"     ]
 [ "streams",   "openReadBytes",        "command 
streams.openReadBytes(filename:str):streams ", "mnstr_open_rstreamwrap;",      
"open a file stream for reading"        ]
 [ "streams",   "openWrite",    "command 
streams.openWrite(filename:str):streams ",     "mnstr_open_wastreamwrap;",     
"open ascii file stream for writing"    ]
-[ "streams",   "openWrite",    "command streams.openWrite(s:streams):streams 
",        "mnstr_stream_wstreamwrap;",    "convert an ascii stream to binary"   
  ]
 [ "streams",   "openWriteBytes",       "command 
streams.openWriteBytes(filename:str):streams ",        
"mnstr_open_wstreamwrap;",      "open a file stream for writing"        ]
 [ "streams",   "readInt",      "command streams.readInt(s:streams):int ",      
"mnstr_readIntwrap;",   "read integer data from the stream"     ]
 [ "streams",   "readStr",      "command streams.readStr(s:streams):str ",      
"mnstr_read_stringwrap;",       "read string data from the stream"      ]
-[ "streams",   "socketRead",   "command streams.socketRead(skt:int, 
name:str):streams ",       "mnstr_socket_rastreamwrap;",   "open ascii socket 
stream for reading"  ]
-[ "streams",   "socketReadBytes",      "command 
streams.socketReadBytes(skt:int, name:str):streams ",  
"mnstr_socket_rstreamwrap;",    "open a socket stream for reading"      ]
-[ "streams",   "socketWrite",  "command streams.socketWrite(skt:int, 
name:str):streams ",      "mnstr_socket_wastreamwrap;",   "open ascii socket 
stream for writing"  ]
-[ "streams",   "socketWriteBytes",     "command 
streams.socketWriteBytes(skt:int, name:str):streams ", 
"mnstr_socket_wstreamwrap;",    "open a socket stream for writing"      ]
 [ "streams",   "writeInt",     "command streams.writeInt(s:streams, 
data:int):void ",  "mnstr_writeIntwrap;",  "write data on the stream"      ]
 [ "streams",   "writeStr",     "command streams.writeStr(s:streams, 
data:str):void ",  "mnstr_write_stringwrap;",      "write data on the stream"   
   ]
 [ "sysmon",    "pause",        "pattern sysmon.pause(id:int):void ",   
"SYSMONpause;", "Suspend a running query"       ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -10907,17 +10907,11 @@ Ready.
 [ "streams",   "close",        "command streams.close(s:streams):void ",       
"mnstr_close_streamwrap;",      "close and destroy the stream s"        ]
 [ "streams",   "flush",        "command streams.flush(s:streams):void ",       
"mnstr_flush_streamwrap;",      "flush the stream"      ]
 [ "streams",   "openRead",     "command streams.openRead(filename:str):streams 
",      "mnstr_open_rastreamwrap;",     "open ascii file stream for reading"    
]
-[ "streams",   "openRead",     "command streams.openRead(s:streams):streams ", 
"mnstr_stream_rstreamwrap;",    "convert an ascii stream to binary"     ]
 [ "streams",   "openReadBytes",        "command 
streams.openReadBytes(filename:str):streams ", "mnstr_open_rstreamwrap;",      
"open a file stream for reading"        ]
 [ "streams",   "openWrite",    "command 
streams.openWrite(filename:str):streams ",     "mnstr_open_wastreamwrap;",     
"open ascii file stream for writing"    ]
-[ "streams",   "openWrite",    "command streams.openWrite(s:streams):streams 
",        "mnstr_stream_wstreamwrap;",    "convert an ascii stream to binary"   
  ]
 [ "streams",   "openWriteBytes",       "command 
streams.openWriteBytes(filename:str):streams ",        
"mnstr_open_wstreamwrap;",      "open a file stream for writing"        ]
 [ "streams",   "readInt",      "command streams.readInt(s:streams):int ",      
"mnstr_readIntwrap;",   "read integer data from the stream"     ]
 [ "streams",   "readStr",      "command streams.readStr(s:streams):str ",      
"mnstr_read_stringwrap;",       "read string data from the stream"      ]
-[ "streams",   "socketRead",   "command streams.socketRead(skt:int, 
name:str):streams ",       "mnstr_socket_rastreamwrap;",   "open ascii socket 
stream for reading"  ]
-[ "streams",   "socketReadBytes",      "command 
streams.socketReadBytes(skt:int, name:str):streams ",  
"mnstr_socket_rstreamwrap;",    "open a socket stream for reading"      ]
-[ "streams",   "socketWrite",  "command streams.socketWrite(skt:int, 
name:str):streams ",      "mnstr_socket_wastreamwrap;",   "open ascii socket 
stream for writing"  ]
-[ "streams",   "socketWriteBytes",     "command 
streams.socketWriteBytes(skt:int, name:str):streams ", 
"mnstr_socket_wstreamwrap;",    "open a socket stream for writing"      ]
 [ "streams",   "writeInt",     "command streams.writeInt(s:streams, 
data:int):void ",  "mnstr_writeIntwrap;",  "write data on the stream"      ]
 [ "streams",   "writeStr",     "command streams.writeStr(s:streams, 
data:str):void ",  "mnstr_write_stringwrap;",      "write data on the stream"   
   ]
 [ "sysmon",    "pause",        "pattern sysmon.pause(id:int):void ",   
"SYSMONpause;", "Suspend a running query"       ]
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
@@ -2131,6 +2131,7 @@ lng getDiskReads(void);
 lng getDiskSpace(void);
 lng getDiskWrites(void);
 str getExceptionMessage(const char *);
+str getExceptionMessageAndState(const char *);
 str getExceptionPlace(const char *);
 enum malexception getExceptionType(const char *);
 int getFltConstant(MalBlkPtr mb, flt val);
@@ -2321,12 +2322,6 @@ int mnstr_readInt_wrap(int *data, Stream
 str mnstr_readIntwrap(int *ret, Stream *S);
 int mnstr_read_string(str *res, Stream *S);
 str mnstr_read_stringwrap(str *res, Stream *s);
-str mnstr_socket_rastreamwrap(Stream *S, int *socket, str *name);
-str mnstr_socket_rstreamwrap(Stream *S, int *socket, str *name);
-str mnstr_socket_wastreamwrap(Stream *S, int *socket, str *name);
-str mnstr_socket_wstreamwrap(Stream *S, int *socket, str *name);
-str mnstr_stream_rstreamwrap(Stream *sout, Stream *sin);
-str mnstr_stream_wstreamwrap(Stream *sout, Stream *sin);
 int mnstr_writeInt_wrap(Stream *S, int *data);
 str mnstr_writeIntwrap(void *ret, Stream *S, int *data);
 int mnstr_write_string(Stream *S, str data);
@@ -2379,6 +2374,7 @@ int optimizerIsApplied(MalBlkPtr mb, str
 str optimizerRef;
 str optimizer_prelude(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str pack2Ref;
+str packIncrementRef;
 str packRef;
 str parametersRef;
 void parseMAL(Client cntxt, Symbol curPrg, int skipcomments, int lines);
@@ -2600,8 +2596,6 @@ str wlrRef;
 str zero_or_oneRef;
 
 # stream
-stream *append_wastream(const char *filename);
-stream *append_wstream(const char *filename);
 stream *block_stream(stream *s);
 stream *block_stream2(stream *s, size_t bufsiz, compression_method comp, 
column_compression colcomp);
 buffer bs2_buffer(stream *s);
@@ -2665,7 +2659,6 @@ int mnstr_readShtArray(stream *s, short 
 int mnstr_readStr(stream *s, char *val);
 ssize_t mnstr_read_block(stream *s, void *buf, size_t elmsize, size_t cnt);
 ssize_t mnstr_readline(stream *s, void *buf, size_t maxcnt);
-stream *mnstr_rstream(stream *s);
 void mnstr_set_byteorder(stream *s, char bigendian);
 void mnstr_settimeout(stream *s, unsigned int ms, int( *func)(void));
 int mnstr_type(stream *s);
@@ -2684,7 +2677,6 @@ int mnstr_writeLngArray(stream *s, const
 int mnstr_writeSht(stream *s, short val);
 int mnstr_writeShtArray(stream *s, const short *val, size_t cnt);
 int mnstr_writeStr(stream *s, const char *val);
-stream *mnstr_wstream(stream *s);
 stream *open_rastream(const char *filename);
 stream *open_rstream(const char *filename);
 stream *open_urlstream(const char *url);
@@ -2696,9 +2688,6 @@ stream *socket_wastream(SOCKET socket, c
 stream *socket_wstream(SOCKET socket, const char *name);
 stream *stream_blackhole_create(void);
 stream *stream_fwf_create(stream *s, size_t num_fields, size_t *widths, char 
filler);
-stream *udp_rastream(const char *hostname, int port, const char *name);
-stream *udp_wastream(const char *hostname, int port, const char *name);
-stream *wbstream(stream *s, size_t buflen);
 
 
 # 21:41:06 >  
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -989,7 +989,16 @@ static int mapi_initialized = 0;
                        return (e);                                     \
                }                                                       \
        } while (0)
-#define REALLOC(p,c)   ((p) = ((p) ? realloc((p),(c)*sizeof(*(p))) : 
malloc((c)*sizeof(*(p)))))
+#define REALLOC(p, c)                                          \
+       do {                                                    \
+               if (p) {                                        \
+                       void *tmp = (p);                        \
+                       (p) = realloc((p), (c) * sizeof(*(p))); \
+                       if ((p) == NULL)                        \
+                               free(tmp);                      \
+               } else                                          \
+                       (p) = malloc((c) * sizeof(*(p)));       \
+       } while (0)
 
 /*
  * Blocking
@@ -1010,11 +1019,13 @@ static int mapi_initialized = 0;
  * errors, and mapi_explain or mapi_explain_query to print a formatted error
  * report.
  */
+static char nomem[] = "Memory allocation failed";
+
 static void
 mapi_clrError(Mapi mid)
 {
        assert(mid);
-       if (mid->errorstr)
+       if (mid->errorstr && mid->errorstr != nomem)
                free(mid->errorstr);
        mid->action = 0;        /* contains references to constants */
        mid->error = 0;
@@ -1026,7 +1037,10 @@ mapi_setError(Mapi mid, const char *msg,
 {
        assert(msg);
        REALLOC(mid->errorstr, strlen(msg) + 1);
-       strcpy(mid->errorstr, msg);
+       if (mid->errorstr == NULL)
+               mid->errorstr = nomem;
+       else
+               strcpy(mid->errorstr, msg);
        mid->error = error;
        mid->action = action;
        return mid->error;
@@ -1574,7 +1588,7 @@ close_result(MapiHdl hdl)
                result->cache.line = NULL;
                result->cache.tuplecount = 0;
        }
-       if (result->errorstr)
+       if (result->errorstr && result->errorstr != nomem)
                free(result->errorstr);
        result->errorstr = NULL;
        memset(result->sqlstate, 0, sizeof(result->sqlstate));
@@ -1613,8 +1627,12 @@ add_error(struct MapiResultSet *result, 
                error += 6;
        }
        REALLOC(result->errorstr, size + strlen(error) + 2);
-       strcpy(result->errorstr + size, error);
-       strcat(result->errorstr + size, "\n");
+       if (result->errorstr == NULL)
+               result->errorstr = nomem;
+       else {
+               strcpy(result->errorstr + size, error);
+               strcat(result->errorstr + size, "\n");
+       }
 }
 
 const char *
@@ -2134,7 +2152,7 @@ mapi_destroy(Mapi mid)
                (void) mapi_disconnect(mid);
        if (mid->blk.buf)
                free(mid->blk.buf);
-       if (mid->errorstr)
+       if (mid->errorstr && mid->errorstr != nomem)
                free(mid->errorstr);
        if (mid->hostname)
                free(mid->hostname);
@@ -2774,7 +2792,8 @@ mapi_reconnect(Mapi mid)
                mid->errorstr = NULL;
                mapi_close_handle(hdl);
                mapi_setError(mid, errorstr, "mapi_reconnect", error);
-               free(errorstr); /* now free it after a copy has been made */
+               if (errorstr != nomem)
+                       free(errorstr); /* now free it after a copy has been 
made */
                close_connection(mid);
                return mid->error;
        }
@@ -3216,9 +3235,14 @@ mapi_prepare(Mapi mid, const char *cmd)
        do {                                                    \
                /* note: k==strlen(hdl->query) */               \
                if (k+len >= lim) {                             \
+                       char *q = hdl->query;                   \
                        lim = k + len + MAPIBLKSIZE;            \
                        hdl->query = realloc(hdl->query, lim);  \
-                       assert(hdl->query);                     \
+                       if (hdl->query == NULL) {               \
+                               free(q);                        \
+                               return;                         \
+                       }                                       \
+                       hdl->query = q;                         \
                }                                               \
        } while (0)
 
@@ -3236,7 +3260,8 @@ mapi_param_store(MapiHdl hdl)
 
        lim = strlen(hdl->template) + MAPIBLKSIZE;
        REALLOC(hdl->query, lim);
-       assert(hdl->query);
+       if (hdl->query == NULL)
+               return;
        hdl->query[0] = 0;
        k = 0;
 
@@ -3252,7 +3277,8 @@ mapi_param_store(MapiHdl hdl)
                if (k + (q - p) >= lim) {
                        lim += MAPIBLKSIZE;
                        REALLOC(hdl->query, lim);
-                       assert(hdl->query);
+                       if (hdl->query == NULL)
+                               return;
                }
                strncpy(hdl->query + k, p, q - p);
                k += q - p;
diff --git a/clients/odbc/driver/ODBCDesc.c b/clients/odbc/driver/ODBCDesc.c
--- a/clients/odbc/driver/ODBCDesc.c
+++ b/clients/odbc/driver/ODBCDesc.c
@@ -163,10 +163,14 @@ setODBCDescRecCount(ODBCDesc *desc, int 
                desc->descRec = NULL;
        } else if (desc->descRec == NULL) {
                assert(desc->sql_desc_count == 0);
-               desc->descRec = (ODBCDescRec *) malloc((count + 1) * 
sizeof(*desc->descRec));
+               desc->descRec = malloc((count + 1) * sizeof(*desc->descRec));
        } else {
+               ODBCDescRec *p;
                assert(desc->sql_desc_count > 0);
-               desc->descRec = (ODBCDescRec *) realloc(desc->descRec, (count + 
1) * sizeof(*desc->descRec));
+               p = realloc(desc->descRec, (count + 1) * 
sizeof(*desc->descRec));
+               if (p == NULL)
+                       return; /* TODO: error handling */
+               desc->descRec = p;
        }
        if (count > desc->sql_desc_count) {
                int i;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to