Changeset: ccb9216caf82 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ccb9216caf82
Modified Files:
        MonetDB5/src/modules/mal/replication.mx
Branch: default
Log Message:

properly return the URI instead of immediately printing it (making it 
impossible to catch)


diffs (49 lines):

diff -r 9304e4c298d0 -r ccb9216caf82 MonetDB5/src/modules/mal/replication.mx
--- a/MonetDB5/src/modules/mal/replication.mx   Fri Jul 16 14:03:56 2010 +0200
+++ b/MonetDB5/src/modules/mal/replication.mx   Fri Jul 16 14:17:01 2010 +0200
@@ -263,9 +263,9 @@
 address MASTERsync
 comment "Login to slave with credentials to initiate submission of the log 
records";
 
-pattern getURI():str
+command getURI():str
 address MASTERgetURI
-comment "Display the URI for the master";
+comment "Return the URI for the master";
 
 command getCutOffTag():oid
 address MASTERgetCutOffTag
@@ -363,7 +363,7 @@
 replication_export str MASTERsync(int  *ret, str *uri, str *usr, str *pw, oid 
*tag);
 replication_export str SLAVEstop(int *ret);
 replication_export str MASTERprelude(int *ret);
-replication_export str MASTERgetURI(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
+replication_export str MASTERgetURI(str *ret);
 replication_export str MASTERgetCutOffTag(int *ret);
 
 replication_export str SLAVEopen(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
@@ -541,16 +541,15 @@
        
 
 str
-MASTERgetURI(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){
-       str mero;
+MASTERgetURI(str *ret)
+{
+       str mero = GDKgetenv("merovingian_uri");
 
-       (void) mb;
-       (void) stk;
-       (void) pci;
-       mero = GDKgetenv("merovingian_uri");
-       if ( ! mero)
-               throw(MAL,"master.getURI","Database is not reachable");
-       stream_printf(cntxt->fdout,"%s\n",mero);
+       if (!mero)
+               throw(MAL, "master.getURI",
+                               "this database is not running under 
merovingian");
+
+       *ret = GDKstrdup(mero);
        return MAL_SUCCEED;
 }
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to