Changeset: 28b60a45ee09 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=28b60a45ee09
Modified Files:
        monetdb5/mal/mal_authorize.c
        sql/backends/monet5/sql.c
Branch: monetdbe-proxy
Log Message:

sys.remote_table_credentials should return NULL instead of error when rt lookup 
fails.


diffs (42 lines):

diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -1035,7 +1035,8 @@ AUTHgetRemoteTableCredentials(const char
 
        p = lookupRemoteTableKey(local_table);
        if (p == BUN_NONE) {
-               throw(MAL, "getRemoteTableCredentials", "No credentials for 
remote table %s found", local_table);
+               // No credentials for remote table with name local_table.
+               return MAL_SUCCEED;
        }
 
        assert(rt_key);
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3762,8 +3762,8 @@ sql_rt_credentials_wrap(Client cntxt, Ma
        bat *uname = getArgReference_bat(stk, pci, 1);
        bat *hash = getArgReference_bat(stk, pci, 2);
        str *table = getArgReference_str(stk, pci, 3);
-       str uris;
-       str unames;
+       str uris = NULL;
+       str unames = NULL;
        str hashs = NULL;
        str msg = MAL_SUCCEED;
        (void)mb;
@@ -3782,11 +3782,11 @@ sql_rt_credentials_wrap(Client cntxt, Ma
                goto bailout;
 
        MT_lock_set(&mal_contextLock);
-       if (BUNappend(urib, uris, false) != GDK_SUCCEED)
+       if (BUNappend(urib, uris? uris: str_nil, false) != GDK_SUCCEED)
                goto lbailout;
-       if (BUNappend(unameb, unames, false) != GDK_SUCCEED)
+       if (BUNappend(unameb, unames? unames: str_nil , false) != GDK_SUCCEED)
                goto lbailout;
-       if (BUNappend(hashb, hashs, false) != GDK_SUCCEED)
+       if (BUNappend(hashb, hashs? hashs: str_nil, false) != GDK_SUCCEED)
                goto lbailout;
        MT_lock_unset(&mal_contextLock);
        BBPkeepref(*uri = urib->batCacheid);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to