Changeset: 703ea0e13817 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=703ea0e13817
Modified Files:
        sql/src/backends/monet5/embeddedclient.c.in
        sql/src/backends/monet5/sql.mx
        sql/src/backends/monet5/sql_gencode.mx
        sql/src/backends/monet5/sql_readline.mx
        sql/src/backends/monet5/sql_scenario.mx
        sql/src/backends/monet5/sql_user.mx
Branch: Oct2010
Log Message:

Use MCgetClient to retrieve MAL client records

For a reason we do not yet completely understand, this used to work
fine, but now it doesn't.  Referencing mal_clients yields in another
address from modules, resulting in not the intended behaviour.  Use
MCgetClient to ensure that we retrieve the mal_client records from
mserver5, which does the main handling of clients.


diffs (135 lines):

diff -r b104735406cc -r 703ea0e13817 sql/src/backends/monet5/embeddedclient.c.in
--- a/sql/src/backends/monet5/embeddedclient.c.in       Thu Nov 04 11:44:41 
2010 +0100
+++ b/sql/src/backends/monet5/embeddedclient.c.in       Thu Nov 04 12:29:47 
2010 +0100
@@ -108,7 +108,7 @@
                "in  := \"" PTRFMT "\":streams;\n"
                "out := \"" PTRFMT "\":streams;\n"
                "mapi.malclient(in, out);\n", PTRFMTCAST in, PTRFMTCAST out);
-       callString(mal_clients, buf, 0);
+       callString(MCgetClient(CONSOLE), buf, 0);
        return 0;
 }
 
diff -r b104735406cc -r 703ea0e13817 sql/src/backends/monet5/sql.mx
--- a/sql/src/backends/monet5/sql.mx    Thu Nov 04 11:44:41 2010 +0100
+++ b/sql/src/backends/monet5/sql.mx    Thu Nov 04 12:29:47 2010 +0100
@@ -2267,7 +2267,7 @@
 mvc_getVersion(lng *version, int *clientid)
 {
        mvc *m = NULL;
-       Client cntxt = mal_clients+*clientid;
+       Client cntxt = MCgetClient(*clientid);
        str msg = getContext(cntxt, NULL, &m, NULL);
 
        if (msg)
@@ -2433,7 +2433,7 @@
 mvc_diff_idxbat_wrap(bat *bid, int *clientid, str *s, str *t, str *i, int 
*access, lng *oldversion, lng *version)
 {
        mvc *m = NULL;
-       Client cntxt = mal_clients+*clientid;
+       Client cntxt = MCgetClient(*clientid);
        str msg = getContext(cntxt, NULL, &m, NULL);
        BAT *b;
 
@@ -2608,7 +2608,7 @@
 mvc_diff_dbat_wrap(bat *bid, int *clientid, str *s, str *t, int *access, lng 
*oldversion, lng *version )
 {
        mvc *m = NULL;
-       Client cntxt = mal_clients+*clientid;
+       Client cntxt = MCgetClient(*clientid);
        str msg = getContext(cntxt, NULL, &m, NULL);
        BAT *b;
 
diff -r b104735406cc -r 703ea0e13817 sql/src/backends/monet5/sql_gencode.mx
--- a/sql/src/backends/monet5/sql_gencode.mx    Thu Nov 04 11:44:41 2010 +0100
+++ b/sql/src/backends/monet5/sql_gencode.mx    Thu Nov 04 12:29:47 2010 +0100
@@ -2252,7 +2252,7 @@
 {
        sql_rel *r;
        mvc *m = (mvc*)M;
-       Client c = mal_clients + m->clientid;
+       Client c = MCgetClient(m->clientid);
        backend *be = ((backend *) c->state[MAL_SCENARIO_PARSER]);
        MalBlkPtr curBlk = 0;
        InstrPtr curInstr = 0;
diff -r b104735406cc -r 703ea0e13817 sql/src/backends/monet5/sql_readline.mx
--- a/sql/src/backends/monet5/sql_readline.mx   Thu Nov 04 11:44:41 2010 +0100
+++ b/sql/src/backends/monet5/sql_readline.mx   Thu Nov 04 12:29:47 2010 +0100
@@ -130,7 +130,7 @@
 void
 init_sql_readline(void)
 {
-       str history = mal_clients[0].history; /* only for console */
+       str history = MCgetClient(CONSOLE)->history; /* only for console */
 
        /* Allow conditional parsing of the ~/.inputrc file. */
        rl_readline_name = "MonetDB";
@@ -142,7 +142,7 @@
 void
 deinit_sql_readline(void)
 {
-       str history = mal_clients[0].history; /* only for console */
+       str history = MCgetClient(CONSOLE)->history; /* only for console */
        if (history) {
                write_history(history);
        }
diff -r b104735406cc -r 703ea0e13817 sql/src/backends/monet5/sql_scenario.mx
--- a/sql/src/backends/monet5/sql_scenario.mx   Thu Nov 04 11:44:41 2010 +0100
+++ b/sql/src/backends/monet5/sql_scenario.mx   Thu Nov 04 12:29:47 2010 +0100
@@ -118,7 +118,7 @@
        (void) stk;
        (void) nr;
        (void)clientid;
-       SQLCacheRemove(mal_clients+clientid, name);
+       SQLCacheRemove(MCgetClient(clientid), name);
 
 #ifdef _SQL_SCENARIO_DEBUG
        mnstr_printf(GDKout, "#monet5_free:%d\n", nr);
diff -r b104735406cc -r 703ea0e13817 sql/src/backends/monet5/sql_user.mx
--- a/sql/src/backends/monet5/sql_user.mx       Thu Nov 04 11:44:41 2010 +0100
+++ b/sql/src/backends/monet5/sql_user.mx       Thu Nov 04 12:29:47 2010 +0100
@@ -77,7 +77,7 @@
        sql_table *users;
        sql_column *users_name;
        str err;
-       Client c = &mal_clients[m->clientid];
+       Client c = MCgetClient(m->clientid);
 
        err = AUTHremoveUser(&c, &user);
        if (err != MAL_SUCCEED) {
@@ -113,7 +113,7 @@
        str pwd;
        sql_schema *s = find_sql_schema(m->session->tr, "sys");
        sql_table *db_user_info, *auths;
-       Client c = &mal_clients[m->clientid];
+       Client c = MCgetClient(m->clientid);
 
        /* prepare the scens BAT: it should contain the sql scenario */
        scens = BATnew(TYPE_str, TYPE_void, 1);
@@ -170,7 +170,7 @@
        BAT *users;
        BUN p;
        mvc *m = (mvc *)mp;
-       Client c = &mal_clients[m->clientid];
+       Client c = MCgetClient(m->clientid);
        
        users = db_users(c);
        if (!users)
@@ -280,7 +280,7 @@
                sqlid schema_id, str oldpasswd)
 {
        mvc *m = (mvc *)_mvc;
-       Client c = &mal_clients[m->clientid];
+       Client c = MCgetClient(m->clientid);
        str err;
 
        if (passwd != NULL) {
@@ -358,7 +358,7 @@
 monet5_rename_user(ptr _mvc, str olduser, str newuser)
 {
        mvc *m = (mvc *)_mvc;
-       Client c = &mal_clients[m->clientid];
+       Client c = MCgetClient(m->clientid);
        str err;
        oid rid;
        sql_schema *sys = find_sql_schema(m->session->tr, "sys");
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to