Changeset: 4d0e4f488b30 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d0e4f488b30
Modified Files:
Branch: default
Log Message:
Merge with Dec2011 branch.
diffs (truncated from 485 to 300 lines):
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
@@ -6472,7 +6472,6 @@ stream *open_rstream(const char *filenam
stream *open_urlstream(const char *url);
stream *open_wastream(const char *filename);
stream *open_wstream(const char *filename);
-int rendezvous_streams(stream **in, stream **out, const char *name);
stream *socket_rastream(SOCKET socket, const char *name);
stream *socket_rstream(SOCKET socket, const char *name);
stream *socket_wastream(SOCKET socket, const char *name);
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -3178,104 +3178,3 @@ wbstream(stream *s, size_t buflen)
}
return ns;
}
-
-/* ------------------------------------------------------------------ */
-
-#ifdef HAVE_PIPE
-static ssize_t
-pipe_write(stream *s, const void *buf, size_t elmsize, size_t cnt)
-{
- size_t size = elmsize * cnt;
- ssize_t sz;
-
- if (s->errnr)
- return -1;
-
- if (size == 0 || elmsize == 0)
- return (ssize_t) cnt;
- sz = write(s->stream_data.i, buf,
-#ifdef NATIVE_WIN32
- (unsigned int) /* on Windows, the length is an
unsigned int... */
-#endif
- size);
- if (sz > 0)
- return (ssize_t) (sz / elmsize);
- if (sz < 0)
- s->errnr = MNSTR_WRITE_ERROR;
- return sz;
-}
-
-static ssize_t
-pipe_read(stream *s, void *buf, size_t elmsize, size_t cnt)
-{
- ssize_t nr = 0;
- size_t res = 0, size = elmsize * cnt;
-
- if (s->errnr)
- return -1;
-
- while (res < size && (nr = read(s->stream_data.i, (void *) ((char *)
buf + res),
-#ifdef NATIVE_WIN32
- (unsigned int) /* on Windows, the
length is an unsigned int... */
-#endif
- (size - res))) > 0) {
- res += nr;
- }
- if (nr < 0) {
- s->errnr = MNSTR_READ_ERROR;
- return nr;
- }
- if (res)
- return (ssize_t) (res / elmsize);
- return 0;
-}
-
-static void
-pipe_close(stream *s)
-{
- if (s->stream_data.i >= 0)
- close(s->stream_data.i);
- s->stream_data.i = -1;
-}
-
-int
-rendezvous_streams(stream **in, stream **out, const char *name)
-{
- stream *sin, *sout;
- int pipes[2];
-
- if ((sin = create_stream(name)) == NULL)
- return 0;
- if ((sout = create_stream(name)) == NULL) {
- destroy(sin);
- return 0;
- }
- if (pipe(pipes) != 0) {
- destroy(sin);
- destroy(sout);
- return 0;
- }
- sin->access = ST_READ;
- sin->close = pipe_close;
- sin->read = pipe_read;
- sin->stream_data.i = pipes[0];
- sin->type = ST_BIN;
- sout->access = ST_WRITE;
- sout->close = pipe_close;
- sout->stream_data.i = pipes[1];
- sout->type = ST_BIN;
- sout->write = pipe_write;
- *in = sin;
- *out = sout;
- return 1;
-}
-#else
-int
-rendezvous_streams(stream **in, stream **out, const char *name)
-{
- (void) in;
- (void) out;
- (void) name;
- return 0;
-}
-#endif /* HAVE_PIPE */
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -177,8 +177,6 @@ stream_export stream *dupFileStream(stre
stream_export stream *iconv_rstream(stream *ss, const char *charset, const
char *name);
stream_export stream *iconv_wstream(stream *ss, const char *charset, const
char *name);
-stream_export int rendezvous_streams(stream **in, stream **out, const char
*name);
-
typedef struct buffer {
char *buf;
size_t pos;
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -428,6 +428,15 @@ SQLinitClient(Client c)
initSQLreferences();
/* initialize the database with predefined SQL functions */
+ if (SQLnewcatalog == 0) {
+ /* check whether table sys.systemfunctions exists: if
+ * it doesn't, this is probably a restart of the
+ * server after an incomplete initialization */
+ sql_schema *s = mvc_bind_schema(m, "sys");
+ sql_table *t = s ? mvc_bind_table(m, s, "systemfunctions") :
NULL;
+ if (t == NULL)
+ SQLnewcatalog = 1;
+ }
if (SQLnewcatalog > 0) {
char path[PATHLENGTH];
str fullname;
diff --git a/sql/test/BugTracker-2011/Tests/All
b/sql/test/BugTracker-2011/Tests/All
--- a/sql/test/BugTracker-2011/Tests/All
+++ b/sql/test/BugTracker-2011/Tests/All
@@ -53,3 +53,5 @@ many-connects-cache.Bug-2904
alter-table-set-read-only.bug-2906
predicate.Bug-2908
history.Bug-2909
+interrupted-initialization.Bug-2875
+case-overflow.Bug-2239
diff --git a/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.sql
b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.sql
@@ -0,0 +1,46 @@
+start transaction;
+
+create table t2239 (
+ station136 smallint
+);
+copy 3 records into t2239 from stdin;
+1537
+1228
+1214
+
+select station136,
+ ((CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) +
+ (CASE WHEN station136 is NULL THEN 0 ELSE station136 END))
+from t2239 order by station136;
+
+rollback;
diff --git a/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.err
b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.err
@@ -0,0 +1,37 @@
+stderr of test 'case-overflow.Bug-2239` in directory 'test/BugTracker-2011`
itself:
+
+
+# 14:42:40 >
+# 14:42:40 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/ufs/sjoerd/Monet-stable/var/MonetDB" "--set" "mapi_open=true"
"--set" "mapi_port=30822" "--set" "monet_prompt=" "--trace" "--forcemito"
"--set" "mal_listing=2" "--dbname=mTests_test_BugTracker-2011" "--set"
"mal_listing=0"
+# 14:42:40 >
+
+# builtin opt gdk_dbname = demo
+# builtin opt gdk_dbfarm = /ufs/sjoerd/Monet-stable/var/monetdb5/dbfarm
+# builtin opt gdk_debug = 0
+# builtin opt gdk_alloc_map = no
+# builtin opt gdk_vmtrim = yes
+# 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 gdk_dbfarm = /ufs/sjoerd/Monet-stable/var/MonetDB
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 30822
+# cmdline opt monet_prompt =
+# cmdline opt mal_listing = 2
+# cmdline opt gdk_dbname = mTests_test_BugTracker-2011
+# cmdline opt mal_listing = 0
+
+# 14:42:40 >
+# 14:42:40 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=madrid"
"--port=30822"
+# 14:42:40 >
+
+
+# 14:42:40 >
+# 14:42:40 > "Done."
+# 14:42:40 >
+
diff --git a/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.out
b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.stable.out
@@ -0,0 +1,77 @@
+stdout of test 'case-overflow.Bug-2239` in directory 'test/BugTracker-2011`
itself:
+
+
+# 14:42:40 >
+# 14:42:40 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/ufs/sjoerd/Monet-stable/var/MonetDB" "--set" "mapi_open=true"
"--set" "mapi_port=30822" "--set" "monet_prompt=" "--trace" "--forcemito"
"--set" "mal_listing=2" "--dbname=mTests_test_BugTracker-2011" "--set"
"mal_listing=0"
+# 14:42:40 >
+
+# MonetDB 5 server v11.5.8
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2011', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically
linked
+# Found 15.662 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2011 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://madrid.ins.cwi.nl:30822/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_history.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_compress.sql
+# loading sql script: 18_dictionary.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 99_system.sql
+
+# 14:42:40 >
+# 14:42:40 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=madrid"
"--port=30822"
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list