Update of /cvsroot/monetdb/clients/src/mapilib
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10052/src/mapilib
Modified Files:
Mapi.mx
Log Message:
propagated changes of Thursday Nov 08 2007 - Saturday Nov 17 2007
from the Clients_1-20 branch to the development trunk
PLEASE NOTE:
I resolved conflicts in
src/java/build.properties
src/java/release.txt
by NOT propagating the version number and release date changes
from the Clients_1-20 branch to the development trunk.
Index: Mapi.mx
===================================================================
RCS file: /cvsroot/monetdb/clients/src/mapilib/Mapi.mx,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Mapi.mx 3 Oct 2007 13:56:18 -0000 1.25
+++ Mapi.mx 17 Nov 2007 18:39:38 -0000 1.26
@@ -2382,7 +2382,7 @@
case '^':{
/* FIXME: there may be multiple
redirects */
char *tmp = result->cache.line[i].rows;
- char *tmp2 = "";
+ char *tmp2 = "", *p = NULL, *db = NULL;
/* redirect, looks like:
*
^mapi:monetdb://localhost:50001/test?lang=sql&user=monetdb */
@@ -2400,23 +2400,26 @@
/* parse components (we store the args
* immediately in the mid... ok, that's
dirty */
tmp += strlen("mapi:monetdb://");
- mid->hostname = tmp;
+ p = tmp;
if ((tmp = strchr(tmp, ':')) != NULL) {
*tmp++ = '\0';
tmp2 = tmp;
} else {
- tmp = mid->hostname;
+ tmp = p;
}
if ((tmp = strchr(tmp, '/')) != NULL) {
*tmp++ = '\0';
mid->port = atoi(tmp2);
if (mid->port == 0)
goto err;
- mid->database = tmp;
+ db = tmp;
} else {
- tmp = mid->hostname;
+ tmp = p;
goto err;
}
+ if (mid->hostname)
+ free(mid->hostname);
+ mid->hostname = strdup(p);
if ((tmp = strchr(tmp, '?')) != NULL) {
char *tmp3;
@@ -2454,6 +2457,10 @@
} else
goto err;
} /* no optional arguments
(weird) */
+ if (mid->database)
+ free(mid->database);
+ mid->database = (db)?strdup(db):NULL;
+
mid->redircnt++;
mapi_close_handle(hdl);
/* reconnect using the new values */
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins