Changeset: 4b4219a8c481 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4b4219a8c481 Added Files: sql/test/json/Tests/jsontext.Bug-6859.stable.err sql/test/json/Tests/jsontext.Bug-6859.stable.out Modified Files: NT/mkodbcwxs.py NT/mksqlwxs.py clients/mapilib/mapi.c common/utils/msabaoth.c ctest/tools/monetdbe/backup.c ctest/tools/monetdbe/example_backup.c ctest/tools/monetdbe/test_helper.c ctest/tools/monetdbe/test_helper.h ctest/tools/monetdbe/test_helper_template.h geom/monetdb5/geom_funcs.mal misc/python/fixlicense.py monetdb5/mal/mal.h monetdb5/mal/mal_prelude.h monetdb5/mal/mel.h monetdb5/modules/atoms/json.c monetdb5/modules/mal/clients.c monetdb5/modules/mal/tracer.c monetdb5/modules/mal/tracer.h sql/backends/monet5/UDF/pyapi3/pytypes.h sql/backends/monet5/sql_import.h sql/backends/monet5/sql_session.mal sql/backends/monet5/vaults/fits/72_fits.sql sql/common/sql_types.c sql/server/cmp_exp_eval.h sql/server/rel_distribute.c sql/server/rel_outer_join_optimizer.h sql/storage/store.c sql/test/SQLancer/Tests/sqlancer03.sql sql/test/SQLancer/Tests/sqlancer03.stable.out testing/exportutils.py testing/malcheck.py tools/merovingian/utils/control.c tools/monetdbe/monetdbe_mapi.c tools/monetdbe/monetdbe_mapi.h Branch: default Log Message:
Merge with oscar branch. diffs (truncated from 749 to 300 lines): diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -1,3 +1,9 @@ +# 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 - 2020 MonetDB B.V. + # python mkodbcwxs.py VERSION makedefs.txt PREFIX > PREFIX/MonetDB-ODBC-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe" -nologo -arch x64/x86 PREFIX/MonetDB-ODBC-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\light.exe" -nologo -sice:ICE03 -sice:ICE60 -sice:ICE82 -ext WixUIExtension PREFIX/MonetDB-ODBC-Installer.wixobj diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -1,3 +1,9 @@ +# 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 - 2020 MonetDB B.V. + # python mksqlwxs.py VERSION makedefs.txt PREFIX > PREFIX/MonetDB5-SQL-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe" -nologo -arch x64/x86 PREFIX/MonetDB5-SQL-Installer.wxs # "c:\Program Files (x86)\WiX Toolset v3.10\bin\light.exe" -nologo -sice:ICE03 -sice:ICE60 -sice:ICE82 -ext WixUIExtension PREFIX/MonetDB5-SQL-Installer.wixobj diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c --- a/clients/mapilib/mapi.c +++ b/clients/mapilib/mapi.c @@ -2716,12 +2716,14 @@ mapi_reconnect(Mapi mid) } else #endif { + (void)pwdhash; snprintf(buf, sizeof(buf), "server requires unknown hash '%.100s'", serverhash); close_connection(mid); return mapi_setError(mid, buf, __func__, MERROR); } +#if defined(HAVE_RIPEMD160_UPDATE) || defined(HAVE_SHA512_UPDATE) || defined(HAVE_SHA384_UPDATE) || defined(HAVE_SHA256_UPDATE) || defined(HAVE_SHA224_UPDATE) || defined(HAVE_SHA1_UPDATE) if (pwdhash == NULL) { snprintf(buf, sizeof(buf), "allocation failure or unknown hash '%.100s'", serverhash); @@ -2733,6 +2735,7 @@ mapi_reconnect(Mapi mid) mid->password = malloc(1 + strlen(pwdhash) + 1); sprintf(mid->password, "\1%s", pwdhash); free(pwdhash); +#endif } p = mid->password + 1; diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c --- a/common/utils/msabaoth.c +++ b/common/utils/msabaoth.c @@ -579,8 +579,6 @@ msab_pickSecret(char **generated_secret) char *secret; char pathbuf[FILENAME_MAX]; char *e; - int fd; - FILE *f; if ((e = getDBPath(pathbuf, sizeof(pathbuf), SECRETFILE)) != NULL) return e; @@ -615,7 +613,9 @@ msab_pickSecret(char **generated_secret) return NULL; #endif #endif - +#if defined(HAVE_OPENSSL) || defined(HAVE_COMMONCRYPTO) + int fd; + FILE *f; for (size_t i = 0; i < SECRET_LENGTH / 2; i++) { snprintf( secret + 2 * i, 3, @@ -650,6 +650,7 @@ msab_pickSecret(char **generated_secret) if (generated_secret) *generated_secret = (char*)secret; return NULL; +#endif } /** diff --git a/ctest/tools/monetdbe/backup.c b/ctest/tools/monetdbe/backup.c --- a/ctest/tools/monetdbe/backup.c +++ b/ctest/tools/monetdbe/backup.c @@ -1,3 +1,10 @@ +/* + * 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 - 2020 MonetDB B.V. + */ #include "monetdb_config.h" #include "stream.h" diff --git a/ctest/tools/monetdbe/example_backup.c b/ctest/tools/monetdbe/example_backup.c --- a/ctest/tools/monetdbe/example_backup.c +++ b/ctest/tools/monetdbe/example_backup.c @@ -1,3 +1,10 @@ +/* + * 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 - 2020 MonetDB B.V. + */ #include "monetdb_config.h" #include <monetdbe.h> diff --git a/ctest/tools/monetdbe/test_helper.c b/ctest/tools/monetdbe/test_helper.c --- a/ctest/tools/monetdbe/test_helper.c +++ b/ctest/tools/monetdbe/test_helper.c @@ -1,3 +1,11 @@ +/* + * 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 - 2020 MonetDB B.V. + */ + #include "test_helper.h" #define _CONCAT(A, B) A##B diff --git a/ctest/tools/monetdbe/test_helper.h b/ctest/tools/monetdbe/test_helper.h --- a/ctest/tools/monetdbe/test_helper.h +++ b/ctest/tools/monetdbe/test_helper.h @@ -1,3 +1,10 @@ +/* + * 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 - 2020 MonetDB B.V. + */ #include "monetdbe.h" diff --git a/ctest/tools/monetdbe/test_helper_template.h b/ctest/tools/monetdbe/test_helper_template.h --- a/ctest/tools/monetdbe/test_helper_template.h +++ b/ctest/tools/monetdbe/test_helper_template.h @@ -1,3 +1,11 @@ +/* + * 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 - 2020 MonetDB B.V. + */ + #include <stddef.h> #ifndef EQUALS diff --git a/geom/monetdb5/geom_funcs.mal b/geom/monetdb5/geom_funcs.mal --- a/geom/monetdb5/geom_funcs.mal +++ b/geom/monetdb5/geom_funcs.mal @@ -1,3 +1,9 @@ +# 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 - 2020 MonetDB B.V. + module geom; function AsText(w:wkb) :str; diff --git a/misc/python/fixlicense.py b/misc/python/fixlicense.py --- a/misc/python/fixlicense.py +++ b/misc/python/fixlicense.py @@ -125,6 +125,7 @@ suffixrules = { '.xs': ('/*', ' */', ' * ', ''), '.y': ('/*', ' */', ' * ', ''), # we also match some complete filenames + 'CMakeLists.txt': ('#[[', '#]]', '# ', ''), 'Makefile': ('', '', '# ', ''), '.merovingian_properties.in': ('', '', '# ', ''), 'configure.ag': ('', '', 'dnl ', ''), @@ -177,7 +178,11 @@ def addlicense(file, pre = None, post = except IOError: print('Cannot create temp file %s.new' % file, file=sys.stderr) return - data = f.read() + try: + data = f.read() + except UnicodeError: + print('UnicodeError in file %s' % file, file=sys.stderr) + return if PERL_COPYRIGHT in data: notice = PERL_COPYRIGHT elif COPYRIGHT_NOTICE in data: @@ -282,7 +287,11 @@ def dellicense(file, pre = None, post = except IOError: print('Cannot create temp file %s.new' % file, file=sys.stderr) return - data = f.read() + try: + data = f.read() + except UnicodeError: + print('UnicodeError in file %s' % file, file=sys.stderr) + return if PERL_COPYRIGHT in data: notice = PERL_COPYRIGHT elif COPYRIGHT_NOTICE in data: diff --git a/monetdb5/mal/mal_prelude.h b/monetdb5/mal/mal_prelude.h --- a/monetdb5/mal/mal_prelude.h +++ b/monetdb5/mal/mal_prelude.h @@ -1,4 +1,3 @@ - /* * 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 diff --git a/monetdb5/mal/mel.h b/monetdb5/mal/mel.h --- a/monetdb5/mal/mel.h +++ b/monetdb5/mal/mel.h @@ -1,3 +1,11 @@ +/* + * 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 - 2020 MonetDB B.V. + */ + #ifndef _MEL_H_ #define _MEL_H_ diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c --- a/monetdb5/modules/atoms/json.c +++ b/monetdb5/modules/atoms/json.c @@ -1178,73 +1178,92 @@ JSONfilter(json *ret, json *js, str *exp // The json string should be valid static char * -JSONplaintext(char *r, size_t *l, JSON *jt, int idx, char sep) +JSONplaintext(char **r, size_t *l, size_t *ilen, JSON *jt, int idx, str sep, size_t sep_len) { int i; - size_t j; + unsigned int j, k; switch (jt->elm[idx].kind) { case JSON_OBJECT: for (i = jt->elm[idx].next; i; i = jt->elm[i].next) if (jt->elm[i].child) - r = JSONplaintext(r, l, jt, jt->elm[i].child, sep); + *r = JSONplaintext(r, l, ilen, jt, jt->elm[i].child, sep, sep_len); break; case JSON_ARRAY: for (i = jt->elm[idx].next; i; i = jt->elm[i].next) - r = JSONplaintext(r, l, jt, i, sep); + *r = JSONplaintext(r, l, ilen, jt, i, sep, sep_len); break; case JSON_ELEMENT: case JSON_VALUE: if (jt->elm[idx].child) - r = JSONplaintext(r, l, jt, jt->elm[idx].child, sep); + *r = JSONplaintext(r, l, ilen, jt, jt->elm[idx].child, sep, sep_len); break; - case JSON_STRING: - for (j = 1; *l > 1 && j < jt->elm[idx].valuelen - 1; j++) { + case JSON_STRING: + // Make sure there is enough space for the value plus the separator plus the NULL byte + if (*l < jt->elm[idx].valuelen - 2 + sep_len + 1) { + char *p = *r - *ilen + *l; + *ilen *= 2; + *r = GDKrealloc(p, *ilen); + *r += *l; + *l = *ilen - *l; + } + for (j = 1; j < jt->elm[idx].valuelen - 1; j++) { if (jt->elm[idx].value[j] == '\\') - *r = jt->elm[idx].value[++j]; + **r = jt->elm[idx].value[++j]; else - *r = jt->elm[idx].value[j]; - r++; - (*l)--; - } - if (*l > 1 && sep) { - *r++ = sep; + **r = jt->elm[idx].value[j]; + (*r)++; (*l)--; } + for(k = 0; k < sep_len; k++) { + **r = *(sep + k); + (*r)++; + } + (*l) -= k; break; default: - for (j = 0; *l > 1 && j < jt->elm[idx].valuelen; j++) { - *r = jt->elm[idx].value[j]; - r++; + if (*l < jt->elm[idx].valuelen + sep_len + 1) { + unsigned int offset = *ilen - *l; + char *p = *r - offset; + *ilen *= 2; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list