Changeset: ac503d127e79 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ac503d127e79
Modified Files:
Branch: default
Log Message:
Merge with default
diffs (truncated from 1495 to 300 lines):
diff --git a/clients/examples/C/sample0.c b/clients/examples/C/sample0.c
--- a/clients/examples/C/sample0.c
+++ b/clients/examples/C/sample0.c
@@ -83,20 +83,8 @@
if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL ||
mapi_error(dbh))
die(dbh, hdl);
} else {
- if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"John\",23);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"Mary\",22);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "print(emp);")) == NULL ||
mapi_error(dbh))
- die(dbh, hdl);
+ fprintf(stderr, "%s: unknown language, only mal and sql
supported\n", argv[0]);
+ exit(1);
}
while (mapi_fetch_row(hdl)) {
diff --git a/clients/examples/C/sample1.c b/clients/examples/C/sample1.c
--- a/clients/examples/C/sample1.c
+++ b/clients/examples/C/sample1.c
@@ -83,20 +83,8 @@
if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL ||
mapi_error(dbh))
die(dbh, hdl);
} else {
- if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"John\",23);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"Mary\",22);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "print(emp);")) == NULL ||
mapi_error(dbh))
- die(dbh, hdl);
+ fprintf(stderr, "%s: unknown language, only mal and sql
supported\n", argv[0]);
+ exit(1);
}
while (mapi_fetch_row(hdl)) {
diff --git a/clients/examples/C/sample2.c b/clients/examples/C/sample2.c
--- a/clients/examples/C/sample2.c
+++ b/clients/examples/C/sample2.c
@@ -78,16 +78,8 @@
if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL ||
mapi_error(dbh))
die(dbh, hdl);
} else {
- if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query_array(dbh, "emp.insert(\"?\",?);", parm))
== NULL || mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "print(emp);")) == NULL ||
mapi_error(dbh))
- die(dbh, hdl);
+ fprintf(stderr, "%s: unknown language, only mal and sql
supported\n", argv[0]);
+ exit(1);
}
if (mapi_bind(hdl, 0, &nme))
diff --git a/clients/examples/C/sample3.c b/clients/examples/C/sample3.c
--- a/clients/examples/C/sample3.c
+++ b/clients/examples/C/sample3.c
@@ -89,20 +89,8 @@
if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL ||
mapi_error(dbh))
die(dbh, hdl);
} else {
- if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"John\",23);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"Mary\",22);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "print(emp);")) == NULL ||
mapi_error(dbh))
- die(dbh, hdl);
+ fprintf(stderr, "%s: unknown language, only mal and sql
supported\n", argv[0]);
+ exit(1);
}
/* Retrieve all tuples in the client cache first */
diff --git a/clients/examples/C/sample4.c b/clients/examples/C/sample4.c
--- a/clients/examples/C/sample4.c
+++ b/clients/examples/C/sample4.c
@@ -90,20 +90,8 @@
if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL ||
mapi_error(dbh))
die(dbh, hdl);
} else {
- if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"John\",23);")) == NULL)
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "emp.insert(\"Mary\",22);")) == NULL
|| mapi_error(dbh))
- die(dbh, hdl);
- if (mapi_close_handle(hdl) != MOK)
- die(dbh, hdl);
- if ((hdl = mapi_query(dbh, "print(emp);")) == NULL ||
mapi_error(dbh))
- die(dbh, hdl);
+ fprintf(stderr, "%s: unknown language, only mal and sql
supported\n", argv[0]);
+ exit(1);
}
rows = mapi_fetch_all_rows(hdl);
diff --git a/clients/examples/C/smack00.c b/clients/examples/C/smack00.c
--- a/clients/examples/C/smack00.c
+++ b/clients/examples/C/smack00.c
@@ -48,8 +48,8 @@
MapiHdl hdl = NULL;
int i, port, n = 20000;
char buf[40];
- int lang = 0;
- char *l = "mil";
+ int lang = 1;
+ char *l = "sql";
/* char *line; */
@@ -61,12 +61,9 @@
l = argv[2];
if (strcmp(argv[2], "sql") == 0)
lang = 1;
- else if (strcmp(argv[2], "xquery") == 0)
- lang = 2;
else if (strcmp(argv[2], "mal") == 0)
lang = 3;
}
- if (lang == 2) n /= 40; /* xquery is so slow..*/
port = atol(argv[1]);
dbh = mapi_connect("localhost", port, "monetdb", "monetdb", l, NULL);
@@ -78,14 +75,10 @@
die(dbh,NULL);
for (i = 0; i < n; i++) {
- if (lang==2)
- snprintf(buf, 40, "%d", i);
- else if (lang==1)
+ if (lang==1)
snprintf(buf, 40, "select %d;", i);
- else if (lang==3)
+ else
snprintf(buf, 40, "io.print(%d);", i);
- else
- snprintf(buf, 40, "print(%d);", i);
if ((hdl = mapi_query(dbh, buf)) == NULL || mapi_error(dbh))
die(dbh, hdl);
while ( (/*line= */ mapi_fetch_line(hdl)) != NULL) {
diff --git a/clients/examples/C/smack01.c b/clients/examples/C/smack01.c
--- a/clients/examples/C/smack01.c
+++ b/clients/examples/C/smack01.c
@@ -49,8 +49,8 @@
int i;
char buf[40], *line;
int port;
- int lang = 0;
- char *l = "mil";
+ int lang = 1;
+ char *l = "sql";
if (argc != 2 && argc != 3) {
printf("usage: smack01 <port> [<language>]\n");
@@ -60,8 +60,6 @@
l = argv[2];
if (strcmp(argv[2], "sql") == 0)
lang = 1;
- else if (strcmp(argv[2], "xquery") == 0)
- lang = 2;
else if (strcmp(argv[2], "mal") == 0)
lang = 3;
}
@@ -79,14 +77,10 @@
if (lang==1 && (mapi_setAutocommit(dbh, 0) != MOK ||
mapi_error(dbh)))
die(dbh,NULL);
- if (lang==2)
- snprintf(buf, 40, "%d", i);
- else if (lang==1)
+ if (lang==1)
snprintf(buf, 40, "select %d;", i);
- else if (lang==3)
+ else
snprintf(buf, 40, "io.print(%d);", i);
- else
- snprintf(buf, 40, "print(%d);", i);
if ((hdl = mapi_query(dbh, buf)) == NULL || mapi_error(dbh))
die(dbh, hdl);
while ((line = mapi_fetch_line(hdl))) {
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -86,27 +86,15 @@
file, set the variable
.B DOTMONETDBFILE
to the empty string in the environment.
-.PP
-When the query language is XQuery, multiple queries are separated by
-the sequence
-.B <>
-(less than and greater than characters)
-on a line by itself.
-This works both in interactive mode and when reading queries from a
-file. When in interactive mode, queries can also be separated by an
-end-of-file. Use a second end-of-file to exit
-.IR mclient .
.SH OPTIONS
.SS
General Options
.TP
\fB\-\-language=\fP\fIlanguage\fP (\fB\-l\fP \fIlanguage\fP)
Specify the query language. The following languages are recognized:
-.BR mil ,
-.BR mal ,
-.BR sql ,
+.B mal
and
-.BR xquery .
+.BR sql .
A unique prefix suffices.
The
.B \-\-language
@@ -142,11 +130,8 @@
must follow immediately after the option.
.TP
\fB\-\-format=\fP\fIformat\fP (\fB\-f\fP \fIformat\fP)
-Specify the output format. For XQuery, the possible values include
-.BR dm ,
-.BR xml ,
-and a number of variations.
-For the other (table-oriented) languages, the possible values are
+Specify the output format.
+The possible values are
.BR sql ,
.BR csv ,
.BR tab ,
@@ -221,27 +206,6 @@
dumping the data of a table. This option can be used when trying to
load data from MonetDB into another database, or when e.g. JDBC
applications are used to reload the dump.
-.SS
-XQuery Options
-.TP
-\fB\-\-collection=\fP\fIcolname\fP (\fB\-C\fP \fIcolname\fP)
-Specify the collection name for the XML document shredded with the
-.B \-\-input
-option.
-.TP
-\fB\-\-input=\fP\fIdocname\fP (\fB\-I\fP \fIdocname\fP)
-The standard input is an XML document which is shredded (added to the
-database). The name of the document is specified using this option.
-The collection name for the document defaults to the name of the
-document but can be specified explicitly with the
-.B \-\-collection
-option.
-Shredding is done before any queries specified with the
-.B \-\-statement
-option or in files specified on the command line are executed.
-.TP
-\fB\-\-time\fP (\fB\-t\fP)
-Print timing information to standard error.
.SH BACKSLASH COMMANDS
.SS
General Commands
@@ -290,8 +254,6 @@
.I mclient
is doing.
This is mostly for debugging purposes.
-.SS
-SQL, MIL, and MAL Commands
.TP
\fB\ee\fP
Echo the query in SQL formatting mode.
@@ -379,24 +341,5 @@
.TP
\fB\ea\fP
Disable auto commit mode.
-.SS
-XQuery Commands
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list