Changeset: 7fc73728e044 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7fc73728e044
Modified Files:
MacOSX/MonetDB.pkgproj
MonetDB.spec
NT/monetdb_config.h.in
clients/mapiclient/ReadlineTools.c
clients/mapiclient/Tests/mclient--help.stable.err
clients/mapiclient/Tests/mclient--help.stable.err.Windows
clients/mapiclient/dump.c
clients/mapiclient/stethoscope.c
clients/mapiclient/tachograph.c
clients/mapiclient/tomograph.c
clients/mapilib/mapi.c
clients/odbc/driver/SQLExecute.c
common/options/monet_options.c
common/stream/stream.c
common/utils/mutils.c
debian/control
gdk/gdk_bbp.c
testing/Mtest.py.in
Branch: default
Log Message:
merge
diffs (truncated from 842 to 300 lines):
diff --git a/MacOSX/MonetDB.pkgproj b/MacOSX/MonetDB.pkgproj
--- a/MacOSX/MonetDB.pkgproj
+++ b/MacOSX/MonetDB.pkgproj
@@ -504,7 +504,7 @@
<key>CONCLUSION_ACTION</key>
<integer>0</integer>
<key>IDENTIFIER</key>
-
<string>com.monetdbsolutions.pkg.monetdb</string>
+ <string>org.monetdb.pkg.monetdb</string>
<key>NAME</key>
<string>MonetDB</string>
<key>OVERWRITE_PERMISSIONS</key>
@@ -815,13 +815,6 @@
<key>PATH_TYPE</key>
<integer>1</integer>
</dict>
- <key>CERTIFICATE</key>
- <dict>
- <key>NAME</key>
- <string>Developer ID Installer: MonetDB
Solutions B.V. (YEJLE7L8A4)</string>
- <key>PATH</key>
-
<string>/Users/sjoerd/Library/Keychains/login.keychain</string>
- </dict>
<key>EXCLUDED_FILES</key>
<array>
<dict>
@@ -991,7 +984,7 @@
</dict>
</array>
<key>NAME</key>
- <string>MonetDB</string>
+ <string>MonetDB-unsigned</string>
</dict>
</dict>
<key>TYPE</key>
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -599,7 +599,9 @@ Requires: %{name}-client%{?_isa} = %{ver
Obsoletes: MonetDB5-server-rdf
%if (0%{?fedora} >= 22)
Recommends: %{name}-SQL-server5
+%if %{bits} == 64
Recommends: MonetDB5-server-hugeint
+%endif
Suggests: %{name}-client
%endif
@@ -655,7 +657,9 @@ fi
%exclude %{_libdir}/monetdb5/rapi.mal
%endif
%exclude %{_libdir}/monetdb5/sql*.mal
+%if %{bits} == 64
%exclude %{_libdir}/monetdb5/*_hge.mal
+%endif
%{_libdir}/monetdb5/*.mal
%if %{?with_geos:1}%{!?with_geos:0}
%exclude %{_libdir}/monetdb5/autoload/*_geom.mal
@@ -685,6 +689,7 @@ fi
%docdir %{_datadir}/doc/MonetDB
%{_datadir}/doc/MonetDB/*
+%if %{bits} == 64
%package -n MonetDB5-server-hugeint
Summary: MonetDB - 128-bit integer support for MonetDB5-server
Group: Application/Databases
@@ -704,6 +709,7 @@ MonetDB5-server component.
%{_libdir}/monetdb5/*_hge.mal
%exclude %{_libdir}/monetdb5/autoload/??_sql_hge.mal
%{_libdir}/monetdb5/autoload/*_hge.mal
+%endif
%package -n MonetDB5-server-devel
Summary: MonetDB development files
@@ -738,7 +744,9 @@ Requires: %{_bindir}/systemd-tmpfiles
Obsoletes: MonetDB-SQL-devel
Obsoletes: %{name}-SQL
%if (0%{?fedora} >= 22)
+%if %{bits} == 64
Recommends: %{name}-SQL-server5-hugeint
+%endif
Suggests: %{name}-client
%endif
@@ -781,16 +789,19 @@ systemd-tmpfiles --create %{_sysconfdir}
%if %{?with_samtools:1}%{!?with_samtools:0}
%exclude %{_libdir}/monetdb5/createdb/*_bam.sql
%endif
+%{_libdir}/monetdb5/createdb/*.sql
+%{_libdir}/monetdb5/sql*.mal
+%if %{bits} == 64
%exclude %{_libdir}/monetdb5/createdb/*_hge.sql
-%{_libdir}/monetdb5/createdb/*.sql
%exclude %{_libdir}/monetdb5/sql*_hge.mal
-%{_libdir}/monetdb5/sql*.mal
+%endif
%doc %{_mandir}/man1/monetdb.1.gz
%doc %{_mandir}/man1/monetdbd.1.gz
%dir %{_datadir}/doc/MonetDB-SQL
%docdir %{_datadir}/doc/MonetDB-SQL
%{_datadir}/doc/MonetDB-SQL/*
+%if %{bits} == 64
%package SQL-server5-hugeint
Summary: MonetDB5 128 bit integer (hugeint) support for SQL
Group: Applications/Databases
@@ -811,6 +822,7 @@ frontend of MonetDB.
%{_libdir}/monetdb5/autoload/??_sql_hge.mal
%{_libdir}/monetdb5/createdb/*_hge.sql
%{_libdir}/monetdb5/sql*_hge.mal
+%endif
%package -n python-monetdb
Summary: Native MonetDB client Python API
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -49,6 +49,14 @@
#include <stddef.h>
#include <ws2tcpip.h>
+#include <sys/types.h>
+#include <stdio.h> /* NULL, printf etc. */
+#include <stdlib.h>
+#include <errno.h>
+#include <stdarg.h> /* va_alist.. */
+
+#include <assert.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
@@ -995,9 +1003,37 @@
/* #undef size_t */
#if _MSC_VER < 1900
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
+#define snprintf c99_snprintf
+#define vsnprintf c99_vsnprintf
+
+/* Microsoft _snprintf returns -1 and does not null-terminate when the
+ * buffer is too small, so work around that */
+
+static inline int
+c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
+{
+ int count = -1;
+
+ if (size != 0)
+ count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
+ if (count == -1)
+ count = _vscprintf(format, ap);
+
+ return count;
+}
+
+static inline int
+c99_snprintf(char *outBuf, size_t size, const char *format, ...)
+{
+ int count;
+ va_list ap;
+
+ va_start(ap, format);
+ count = c99_vsnprintf(outBuf, size, format, ap);
+ va_end(ap);
+
+ return count;
+}
#endif
/* type used by connect */
@@ -1020,20 +1056,6 @@ typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
-#if _MSC_VER < 1500
-#ifndef vsnprintf
-#define vsnprintf _vsnprintf
-#endif
-#endif
-
-#include <sys/types.h>
-#include <stdio.h> /* NULL, printf etc. */
-#include <stdlib.h>
-#include <errno.h>
-#include <stdarg.h> /* va_alist.. */
-
-#include <assert.h>
-
/* normally defined in stdbool.h, but that doesn't exist on Windows */
#define true 1
#define false 0
diff --git a/clients/mapiclient/ReadlineTools.c
b/clients/mapiclient/ReadlineTools.c
--- a/clients/mapiclient/ReadlineTools.c
+++ b/clients/mapiclient/ReadlineTools.c
@@ -61,12 +61,16 @@ sql_tablename_generator(const char *text
static MapiHdl table_hdl;
if (!state) {
- char query[512];
+ char *query;
seekpos = 0;
len = strlen(text);
- snprintf(query, sizeof(query), "SELECT t.\"name\", s.\"name\"
FROM \"sys\".\"tables\" t, \"sys\".\"schemas\" s where t.schema_id = s.id AND
t.\"name\" like '%s%%'", text);
- if ((table_hdl = mapi_query(_mid, query)) == NULL ||
mapi_error(_mid)) {
+ if ((query = malloc(len + 128)) == NULL)
+ return NULL;
+ snprintf(query, len + 128, "SELECT t.\"name\", s.\"name\" FROM
\"sys\".\"tables\" t, \"sys\".\"schemas\" s where t.schema_id = s.id AND
t.\"name\" like '%s%%'", text);
+ table_hdl = mapi_query(_mid, query);
+ free(query);
+ if (table_hdl == NULL || mapi_error(_mid)) {
if (table_hdl) {
mapi_explain_query(table_hdl, stderr);
mapi_close_handle(table_hdl);
@@ -176,7 +180,7 @@ static char *mal_commands[] = {
static int
mal_help(int cnt, int key)
{
- char *name, *c, buf[512];
+ char *name, *c, *buf;
int seekpos = 0, rowcount;
MapiHdl table_hdl;
@@ -188,8 +192,12 @@ mal_help(int cnt, int key)
c--;
while (c > rl_line_buffer && !isspace(*c))
c--;
- snprintf(buf, sizeof(buf), "manual.help(\"%s\");", c);
- if ((table_hdl = mapi_query(_mid, buf)) == NULL || mapi_error(_mid)) {
+ if ((buf = malloc(strlen(c) + 20)) == NULL)
+ return 0;
+ snprintf(buf, strlen(c) + 20, "manual.help(\"%s\");", c);
+ table_hdl = mapi_query(_mid, buf);
+ free(buf);
+ if (table_hdl == NULL || mapi_error(_mid)) {
if (table_hdl) {
mapi_explain_query(table_hdl, stderr);
mapi_close_handle(table_hdl);
@@ -220,7 +228,7 @@ mal_command_generator(const char *text,
static int idx;
static int seekpos, len, rowcount;
static MapiHdl table_hdl;
- char *name, buf[512];
+ char *name, *buf;
/* we pick our own portion of the linebuffer */
text = rl_line_buffer + strlen(rl_line_buffer) - 1;
@@ -250,14 +258,18 @@ mal_command_generator(const char *text,
text = c + 2;
while (isspace((int) *text))
text++;
+ if ((buf = malloc(strlen(text) + 32)) == NULL)
+ return NULL;
if (strchr(text, '.') == NULL)
- snprintf(buf, sizeof(buf),
+ snprintf(buf, strlen(text) + 32,
"manual.completion(\"%s.*(\");", text);
else
- snprintf(buf, sizeof(buf),
+ snprintf(buf, strlen(text) + 32,
"manual.completion(\"%s(\");", text);
seekpos = 0;
- if ((table_hdl = mapi_query(_mid, buf)) == NULL ||
mapi_error(_mid)) {
+ table_hdl = mapi_query(_mid, buf);
+ free(buf);
+ if (table_hdl == NULL || mapi_error(_mid)) {
if (table_hdl) {
mapi_explain_query(table_hdl, stderr);
mapi_close_handle(table_hdl);
diff --git a/clients/mapiclient/Tests/mclient--help.stable.err
b/clients/mapiclient/Tests/mclient--help.stable.err
--- a/clients/mapiclient/Tests/mclient--help.stable.err
+++ b/clients/mapiclient/Tests/mclient--help.stable.err
@@ -38,7 +38,6 @@ SQL specific opions
-w nr | --width=nr for pagination
-D | --dump create an SQL dump
-N | --inserts use INSERT INTO statements when dumping
- -P | --progress show progress bar
The file argument can be - for stdin
# 18:57:57 >
diff --git a/clients/mapiclient/Tests/mclient--help.stable.err.Windows
b/clients/mapiclient/Tests/mclient--help.stable.err.Windows
--- a/clients/mapiclient/Tests/mclient--help.stable.err.Windows
+++ b/clients/mapiclient/Tests/mclient--help.stable.err.Windows
@@ -37,7 +37,6 @@ SQL specific opions
-w nr | --width=nr for pagination
-D | --dump create an SQL dump
-N | --inserts use INSERT INTO statements when dumping
- -P | --progress show progress bar
The file argument can be - for stdin
# 18:57:57 >
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -212,7 +212,7 @@ dump_foreign_keys(Mapi mid, const char *
"fkt.name = '%s' "
"ORDER BY fkk.name, nr", schema, tname);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list