Changeset: 1d86620d42de for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d86620d42de Added Files: sql/jdbc/tests/Tests/SQLcopyinto.SQL.bat sql/jdbc/tests/Tests/SQLcopyinto.SQL.sh sql/jdbc/tests/Tests/SQLcopyinto.stable.err sql/jdbc/tests/Tests/SQLcopyinto.stable.out Modified Files: clients/mapiclient/tachograph.c common/utils/mcrypt.c configure.ag gdk/gdk_utils.c sql/jdbc/tests/Tests/All Branch: analytics Log Message:
Merge with default diffs (290 lines): diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c --- a/clients/mapiclient/tachograph.c +++ b/clients/mapiclient/tachograph.c @@ -204,7 +204,7 @@ showBar(int level, int64_t clk, char *st nl = level/2-prevlevel/2; if( level != 100 && (nl == 0 || level/2 <= prevlevel/2)) return; - assert(MSGLEN < BUFSIZ); + static_assert(MSGLEN < BUFSIZ, "MSGLEN too small"); if(prevlevel == 0) printf("["); else diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c --- a/common/utils/mcrypt.c +++ b/common/utils/mcrypt.c @@ -76,7 +76,7 @@ mcrypt_MD5Sum(const char *string, size_t unsigned char md[MD5_DIGEST_LENGTH]; char *ret; - assert(MD5_DIGEST_LENGTH == 16); + static_assert(MD5_DIGEST_LENGTH == 16, "MD5_DIGEST_LENGTH should be 16"); MD5_Init(&c); MD5_Update(&c, string, len); MD5_Final(md, &c); @@ -114,7 +114,7 @@ mcrypt_SHA1Sum(const char *string, size_ unsigned char md[SHA_DIGEST_LENGTH]; char *ret; - assert(SHA_DIGEST_LENGTH == 20); + static_assert(SHA_DIGEST_LENGTH == 20, "SHA_DIGEST_LENGTH should be 20"); SHA1_Init(&c); SHA1_Update(&c, string, len); SHA1_Final(md, &c); @@ -152,7 +152,7 @@ mcrypt_SHA224Sum(const char *string, siz unsigned char md[SHA224_DIGEST_LENGTH]; char *ret; - assert(SHA224_DIGEST_LENGTH == 28); + static_assert(SHA224_DIGEST_LENGTH == 28, "SHA224_DIGEST_LENGTH should be 28"); SHA224_Init(&c); SHA224_Update(&c, string, len); SHA224_Final(md, &c); @@ -193,7 +193,7 @@ mcrypt_SHA256Sum(const char *string, siz unsigned char md[SHA256_DIGEST_LENGTH]; char *ret; - assert(SHA256_DIGEST_LENGTH == 32); + static_assert(SHA256_DIGEST_LENGTH == 32, "SHA256_DIGEST_LENGTH should be 32"); SHA256_Init(&c); SHA256_Update(&c, string, len); SHA256_Final(md, &c); @@ -236,7 +236,7 @@ mcrypt_SHA384Sum(const char *string, siz unsigned char md[SHA384_DIGEST_LENGTH]; char *ret; - assert(SHA384_DIGEST_LENGTH == 48); + static_assert(SHA384_DIGEST_LENGTH == 48, "SHA384_DIGEST_LENGTH should be 48"); SHA384_Init(&c); SHA384_Update(&c, string, len); SHA384_Final(md, &c); @@ -283,7 +283,7 @@ mcrypt_SHA512Sum(const char *string, siz unsigned char md[SHA512_DIGEST_LENGTH]; char *ret; - assert(SHA512_DIGEST_LENGTH == 64); + static_assert(SHA512_DIGEST_LENGTH == 64, "SHA512_DIGEST_LENGTH should be 64"); SHA512_Init(&c); SHA512_Update(&c, string, len); SHA512_Final(md, &c); @@ -335,7 +335,7 @@ mcrypt_RIPEMD160Sum(const char *string, unsigned char md[RIPEMD160_DIGEST_LENGTH]; char *ret; - assert(RIPEMD160_DIGEST_LENGTH == 20); + static_assert(RIPEMD160_DIGEST_LENGTH == 20, "RIPEMD160_DIGEST_LENGTH should be 20"); RIPEMD160_Init(&c); RIPEMD160_Update(&c, string, len); RIPEMD160_Final(md, &c); diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -2848,6 +2848,12 @@ typedef enum { @%:@include <stdbool.h> @%:@include <assert.h> +@%:@ifndef static_assert +/* static_assert is a C11 feature, defined in assert.h which also exists + * in many other compilers we ignore it if the compiler doesn't support it */ +@%:@define static_assert(expr, mesg) ((void) 0) +@%:@endif + @%:@if defined(HAVE___INT128) typedef __int128 hge; typedef unsigned __int128 uhge; diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -443,18 +443,18 @@ GDKinit(opt *set, int setlen) char buf[16]; /* some sanity checks (should also find if symbols are not defined) */ - assert(sizeof(char) == SIZEOF_CHAR); - assert(sizeof(short) == SIZEOF_SHORT); - assert(sizeof(int) == SIZEOF_INT); - assert(sizeof(long) == SIZEOF_LONG); - assert(sizeof(lng) == SIZEOF_LNG); + static_assert(sizeof(char) == SIZEOF_CHAR, "error in configure: bad value for SIZEOF_CHAR"); + static_assert(sizeof(short) == SIZEOF_SHORT, "error in configure: bad value for SIZEOF_SHORT"); + static_assert(sizeof(int) == SIZEOF_INT, "error in configure: bad value for SIZEOF_INT"); + static_assert(sizeof(long) == SIZEOF_LONG, "error in configure: bad value for SIZEOF_LONG"); + static_assert(sizeof(lng) == SIZEOF_LNG, "error in configure: bad value for SIZEOF_LNG"); #ifdef HAVE_HGE - assert(sizeof(hge) == SIZEOF_HGE); + static_assert(sizeof(hge) == SIZEOF_HGE, "error in configure: bad value for SIZEOF_HGE"); #endif - assert(sizeof(oid) == SIZEOF_OID); - assert(sizeof(void *) == SIZEOF_VOID_P); - assert(sizeof(size_t) == SIZEOF_SIZE_T); - assert(SIZEOF_OID == SIZEOF_INT || SIZEOF_OID == SIZEOF_LNG); + static_assert(sizeof(oid) == SIZEOF_OID, "error in configure: bad value for SIZEOF_OID"); + static_assert(sizeof(void *) == SIZEOF_VOID_P, "error in configure: bad value for SIZEOF_VOID_P"); + static_assert(sizeof(size_t) == SIZEOF_SIZE_T, "error in configure: bad value for SIZEOF_SIZE_T"); + static_assert(SIZEOF_OID == SIZEOF_INT || SIZEOF_OID == SIZEOF_LNG, "SIZEOF_OID should be equal to SIZEOF_INT or SIZEOF_LNG"); #ifdef NEED_MT_LOCK_INIT MT_lock_init(&MT_system_lock,"MT_system_lock"); diff --git a/sql/jdbc/tests/Tests/All b/sql/jdbc/tests/Tests/All --- a/sql/jdbc/tests/Tests/All +++ b/sql/jdbc/tests/Tests/All @@ -1,3 +1,4 @@ +HAVE_JDBCTESTS?SQLcopyinto HAVE_JDBCTESTS?Test_Cautocommit HAVE_JDBCTESTS?Test_CisValid HAVE_JDBCTESTS?Test_Clargequery diff --git a/sql/jdbc/tests/Tests/SQLcopyinto.SQL.bat b/sql/jdbc/tests/Tests/SQLcopyinto.SQL.bat new file mode 100755 --- /dev/null +++ b/sql/jdbc/tests/Tests/SQLcopyinto.SQL.bat @@ -0,0 +1,1 @@ +@call "%TSTSRCDIR%\Test.SQL.bat" %* diff --git a/sql/jdbc/tests/Tests/SQLcopyinto.SQL.sh b/sql/jdbc/tests/Tests/SQLcopyinto.SQL.sh new file mode 100755 --- /dev/null +++ b/sql/jdbc/tests/Tests/SQLcopyinto.SQL.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +$TSTSRCDIR/Test.SQL.sh $* diff --git a/sql/jdbc/tests/Tests/SQLcopyinto.stable.err b/sql/jdbc/tests/Tests/SQLcopyinto.stable.err new file mode 100644 --- /dev/null +++ b/sql/jdbc/tests/Tests/SQLcopyinto.stable.err @@ -0,0 +1,42 @@ +stderr of test 'SQLcopyinto` in directory 'sql/jdbc/tests` itself: + + +# 12:51:59 > +# 12:51:59 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=33746" "--set" "mapi_usock=/var/tmp/mtest-12494/.s.monetdb.33746" "--set" "monet_prompt=" "--forcemito" "--dbpath=/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_jdbc_tests" "--set" "embedded_r=yes" "--set" "embedded_py=true" "--set" "embedded_c=true" +# 12:51:59 > + +# builtin opt gdk_dbpath = /export/scratch1/dinther/INSTALL/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 33746 +# cmdline opt mapi_usock = /var/tmp/mtest-12494/.s.monetdb.33746 +# cmdline opt monet_prompt = +# cmdline opt gdk_dbpath = /export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_jdbc_tests +# cmdline opt embedded_r = yes +# cmdline opt embedded_py = true +# cmdline opt embedded_c = true +# cmdline opt gdk_debug = 553648138 + +# 12:52:00 > +# 12:52:00 > "./SQLcopyinto.SQL.sh" "SQLcopyinto" +# 12:52:00 > + + +# 12:52:00 > +# 12:52:00 > java SQLcopyinto "jdbc:monetdb://catskill:33746/mTests_sql_jdbc_tests?user=monetdb&password=monetdb" +# 12:52:00 > + + +# 12:52:00 > +# 12:52:00 > "Done." +# 12:52:00 > + diff --git a/sql/jdbc/tests/Tests/SQLcopyinto.stable.out b/sql/jdbc/tests/Tests/SQLcopyinto.stable.out new file mode 100644 --- /dev/null +++ b/sql/jdbc/tests/Tests/SQLcopyinto.stable.out @@ -0,0 +1,90 @@ +stdout of test 'SQLcopyinto` in directory 'sql/jdbc/tests` itself: + + +# 12:51:59 > +# 12:51:59 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=33746" "--set" "mapi_usock=/var/tmp/mtest-12494/.s.monetdb.33746" "--set" "monet_prompt=" "--forcemito" "--dbpath=/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_jdbc_tests" "--set" "embedded_r=yes" "--set" "embedded_py=true" "--set" "embedded_c=true" +# 12:51:59 > + +# MonetDB 5 server v11.29.4 +# This is an unreleased version +# Serving database 'mTests_sql_jdbc_tests', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers +# Found 31.307 GiB available main-memory. +# Copyright (c) 1993 - July 2008 CWI. +# Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved +# Visit https://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://catskill.da.cwi.nl:33746/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-12494/.s.monetdb.33746 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +# MonetDB/Python2 module loaded +# MonetDB/R module loaded + +Ready. + +# 12:52:00 > +# 12:52:00 > "./SQLcopyinto.SQL.sh" "SQLcopyinto" +# 12:52:00 > + + +# 12:52:00 > +# 12:52:00 > java SQLcopyinto "jdbc:monetdb://catskill:33746/mTests_sql_jdbc_tests?user=monetdb&password=monetdb" +# 12:52:00 > + +SQLcopyinto started +Connected to MonetDB server + +CopyInto STDIN begin +Before connecting to MonetDB server via MapiSocket +Connected to MonetDB server via MapiSocket +Before sending data to STDIN +Completed sending data via STDIN +CopyInto STDIN end + +Listing uploaded data: +Row data: 0, val_0 +Row data: 1, val_1 +Row data: 2, val_2 +Row data: 3, val_3 +Row data: 4, val_4 +Row data: 5, val_5 +Row data: 6, val_6 +Row data: 7, val_7 +Row data: 8, val_8 +Row data: 9, val_9 +Row data: 10, val_10 +Row data: 11, val_11 +Row data: 12, val_12 +Row data: 13, val_13 +Row data: 14, val_14 +Row data: 15, val_15 +Row data: 16, val_16 +Row data: 17, val_17 +Row data: 18, val_18 +Row data: 19, val_19 +Row data: 20, val_20 +Row data: 21, val_21 +Row data: 22, val_22 +Row data: 23, val_23 +Row data: 24, val_24 +Row data: 25, val_25 +Row data: 26, val_26 +Row data: 27, val_27 +Row data: 28, val_28 +Row data: 29, val_29 +Row data: 30, val_30 +Row data: 31, val_31 +Row data: 32, val_32 +Row data: 33, val_33 +Row data: 34, val_34 +Row data: 35, val_35 +Row data: 36, val_36 +Row data: 37, val_37 +Row data: 38, val_38 +Row data: 39, val_39 +SQLcopyinto completed + +# 12:52:00 > +# 12:52:00 > "Done." +# 12:52:00 > + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list