Changeset: 361a09763356 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/361a09763356
Modified Files:
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_user.c
        sql/common/sql_backend.c
        sql/common/sql_backend.h
        sql/server/rel_schema.c
        sql/server/sql_parser.y
        sql/server/sql_privileges.c
        sql/server/sql_privileges.h
Branch: userprofile
Log Message:

remove wlc user option


diffs (241 lines):

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
@@ -5999,7 +5999,7 @@ static mel_func sql_init_funcs[] = {
  pattern("sqlcatalog", "revoke", SQLrevoke, false, "Catalog operation revoke", 
args(0,7, 
arg("sname",str),arg("tbl",str),arg("grantee",str),arg("privs",int),arg("cname",str),arg("grant",int),arg("grantor",int))),
  pattern("sqlcatalog", "grant_function", SQLgrant_function, false, "Catalog 
operation grant_function", args(0,6, 
arg("sname",str),arg("fcnid",int),arg("grantee",str),arg("privs",int),arg("grant",int),arg("grantor",int))),
  pattern("sqlcatalog", "revoke_function", SQLrevoke_function, false, "Catalog 
operation revoke_function", args(0,6, 
arg("sname",str),arg("fcnid",int),arg("grantee",str),arg("privs",int),arg("grant",int),arg("grantor",int))),
- pattern("sqlcatalog", "create_user", SQLcreate_user, false, "Catalog 
operation create_user", args(0,11, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("schemapath",str),arg("fullname",str),
 arg("max_memory", lng), arg("max_workers", int), arg("wlc", bit), 
arg("optimizer", str), arg("default_role", str))),
+ pattern("sqlcatalog", "create_user", SQLcreate_user, false, "Catalog 
operation create_user", args(0,10, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("schemapath",str),arg("fullname",str),
 arg("max_memory", lng), arg("max_workers", int), arg("optimizer", str), 
arg("default_role", str))),
  pattern("sqlcatalog", "drop_user", SQLdrop_user, false, "Catalog operation 
drop_user", args(0,2, arg("sname",str),arg("action",int))),
  pattern("sqlcatalog", "drop_user", SQLdrop_user, false, "Catalog operation 
drop_user", args(0,3, arg("sname",str),arg("auth",str),arg("action",int))),
  pattern("sqlcatalog", "alter_user", SQLalter_user, false, "Catalog operation 
alter_user", args(0,6, 
arg("sname",str),arg("passwrd",str),arg("enc",int),arg("schema",str),arg("schemapath",str),arg("oldpasswrd",str))),
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -1744,13 +1744,11 @@ SQLcreate_user(Client cntxt, MalBlkPtr m
        char *fullname = SaveArgReference(stk, pci, 6);
        lng max_memory = *getArgReference_lng(stk, pci, 7);
        int max_workers = *getArgReference_int(stk, pci, 8);
-       bool wlc = *getArgReference_bit(stk, pci, 9);
-       char *optimizer = SaveArgReference(stk, pci, 10);
-       char *default_role = SaveArgReference(stk, pci, 11);
+       char *optimizer = SaveArgReference(stk, pci, 9);
+       char *default_role = SaveArgReference(stk, pci, 10);
 
        initcontext();
-       msg = sql_create_user(sql, sname, passwd, enc, fullname, schema, 
schema_path, max_memory, max_workers, wlc,
-                       optimizer, default_role);
+       msg = sql_create_user(sql, sname, passwd, enc, fullname, schema, 
schema_path, max_memory, max_workers, optimizer, default_role);
        return msg;
 }
 
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -161,7 +161,7 @@ parse_schema_path_str(mvc *m, str schema
 }
 
 static str
-monet5_create_user(ptr _mvc, str user, str passwd, char enc, str fullname, 
sqlid schema_id, str schema_path, sqlid grantorid, lng max_memory, int 
max_workers, bool wlc, str optimizer, sqlid role_id)
+monet5_create_user(ptr _mvc, str user, str passwd, char enc, str fullname, 
sqlid schema_id, str schema_path, sqlid grantorid, lng max_memory, int 
max_workers, str optimizer, sqlid role_id)
 {
        mvc *m = (mvc *) _mvc;
        oid uid = 0;
@@ -189,7 +189,7 @@ monet5_create_user(ptr _mvc, str user, s
 
        user_id = store_next_oid(m->session->tr->store);
        sqlid default_role_id = role_id > 0 ? role_id : user_id;
-       if ((log_res = store->table_api.table_insert(m->session->tr, 
db_user_info, &user, &fullname, &schema_id, &schema_path, &max_memory, 
&max_workers, &wlc, &optimizer, &default_role_id))) {
+       if ((log_res = store->table_api.table_insert(m->session->tr, 
db_user_info, &user, &fullname, &schema_id, &schema_path, &max_memory, 
&max_workers, &optimizer, &default_role_id))) {
                if (!enc)
                        free(pwd);
                throw(SQL, "sql.create_user", SQLSTATE(42000) "Create user 
failed%s", log_res == LOG_CONFLICT ? " due to conflict with another 
transaction" : "");
@@ -312,7 +312,6 @@ monet5_create_privileges(ptr _mvc, sql_s
        mvc_create_column_(&col, m, t, "schema_path", "clob", 0);
        mvc_create_column_(&col, m, t, "max_memory", "bigint", bits2digits(64));
        mvc_create_column_(&col, m, t, "max_workers", "int", 9);
-       mvc_create_column_(&col, m, t, "wlc", "boolean", 1);
        mvc_create_column_(&col, m, t, "optimizer", "varchar", 1024);
        mvc_create_column_(&col, m, t, "default_role", "int", 9);
        uinfo = t;
@@ -345,7 +344,6 @@ monet5_create_privileges(ptr _mvc, sql_s
        mvc_create_column_(&col, m, t, "schema_path", "clob", 0);
        mvc_create_column_(&col, m, t, "max_memory", "bigint", bits2digits(64));
        mvc_create_column_(&col, m, t, "max_workers", "int", 9);
-       mvc_create_column_(&col, m, t, "wlc", "boolean", 1);
        mvc_create_column_(&col, m, t, "optimizer", "varchar", 1024);
        mvc_create_column_(&col, m, t, "default_role", "int", 9);
 
@@ -361,12 +359,11 @@ monet5_create_privileges(ptr _mvc, sql_s
        char *optimizer = default_optimizer;
        lng max_memory = 0;
        int max_workers = 0;
-       bool wlc = true;
        sqlid default_role_id = USER_MONETDB;
 
 
-       store->table_api.table_insert(m->session->tr, uinfo, &username, 
&fullname, &schema_id, &schema_path, &max_memory, &max_workers,
-                       &wlc, &optimizer, &default_role_id);
+       store->table_api.table_insert(m->session->tr, uinfo, &username, 
&fullname, &schema_id, &schema_path, &max_memory,
+                       &max_workers, &optimizer, &default_role_id);
 }
 
 static int
diff --git a/sql/common/sql_backend.c b/sql/common/sql_backend.c
--- a/sql/common/sql_backend.c
+++ b/sql/common/sql_backend.c
@@ -35,11 +35,11 @@ backend_freecode(const char *mod, int cl
 }
 
 char *
-backend_create_user(ptr mvc, char *user, char *passwd, char enc, char 
*fullname, sqlid defschemid, char *schema_path, sqlid grantor, lng max_memory, 
int max_workers, bool wlc, char *optimizer, sqlid role_id)
+backend_create_user(ptr mvc, char *user, char *passwd, char enc, char 
*fullname, sqlid defschemid, char *schema_path, sqlid grantor, lng max_memory, 
int max_workers, char *optimizer, sqlid role_id)
 {
        if (be_funcs.fcuser != NULL)
                return(be_funcs.fcuser(mvc, user, passwd, enc, fullname, 
defschemid, schema_path, grantor, max_memory,
-                                       max_workers, wlc, optimizer, role_id));
+                                       max_workers, optimizer, role_id));
        return(NULL);
 }
 
diff --git a/sql/common/sql_backend.h b/sql/common/sql_backend.h
--- a/sql/common/sql_backend.h
+++ b/sql/common/sql_backend.h
@@ -15,7 +15,7 @@
 
 typedef void (*freecode_fptr) (const char *mod, int clientid, const char 
*name);
 
-typedef char *(*create_user_fptr) (ptr mvc, char *user, char *passwd, char 
enc, char *fullname, sqlid schema_id, char *schema_path, sqlid grantor_id, lng 
max_memory, int max_workers, bool wlc, str optimizer, sqlid role_id);
+typedef char *(*create_user_fptr) (ptr mvc, char *user, char *passwd, char 
enc, char *fullname, sqlid schema_id, char *schema_path, sqlid grantor_id, lng 
max_memory, int max_workers, str optimizer, sqlid role_id);
 typedef int  (*drop_user_fptr) (ptr mvc, char *user);
 typedef int  (*find_user_fptr) (ptr mvc, char *user);
 typedef void (*create_privileges_fptr) (ptr mvc, sql_schema *s);
@@ -48,7 +48,7 @@ typedef struct _backend_functions {
 
 extern void backend_freecode(const char *mod, int clientid, const char *name);
 
-extern char *backend_create_user(ptr mvc, char *user, char *passwd, char enc, 
char *fullname, sqlid defschemid, char *schema_path, sqlid grantor, lng 
max_memory, int max_workers, bool wlc, char *optimizer, sqlid role_id);
+extern char *backend_create_user(ptr mvc, char *user, char *passwd, char enc, 
char *fullname, sqlid defschemid, char *schema_path, sqlid grantor, lng 
max_memory, int max_workers, char *optimizer, sqlid role_id);
 extern int  backend_drop_user(ptr mvc, char *user);
 extern int  backend_find_user(ptr mp, char *user);
 extern void backend_create_privileges(ptr mvc, sql_schema *s);
diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
--- a/sql/server/rel_schema.c
+++ b/sql/server/rel_schema.c
@@ -2262,7 +2262,7 @@ rel_create_index(mvc *sql, char *iname, 
 }
 
 static sql_rel *
-rel_create_user(sql_allocator *sa, char *user, char *passwd, int enc, char 
*fullname, char *schema, char *schema_path, lng max_memory, int max_workers, 
bool wlc, char *optimizer, char *default_role)
+rel_create_user(sql_allocator *sa, char *user, char *passwd, int enc, char 
*fullname, char *schema, char *schema_path, lng max_memory, int max_workers, 
char *optimizer, char *default_role)
 {
        sql_rel *rel = rel_create(sa);
        list *exps = new_exp_list(sa);
@@ -2277,7 +2277,6 @@ rel_create_user(sql_allocator *sa, char 
        append(exps, exp_atom_clob(sa, fullname));
        append(exps, exp_atom_lng(sa, max_memory));
        append(exps, exp_atom_int(sa, max_workers));
-       append(exps, exp_atom_bool(sa, wlc));
        append(exps, exp_atom_clob(sa, optimizer));
        append(exps, exp_atom_clob(sa, default_role));
        rel->l = NULL;
@@ -2926,10 +2925,9 @@ rel_schemas(sql_query *query, symbol *s)
                                  l->h->next->next->next->data.sval,    /* 
dschema */
                                  l->h->next->next->next->next->data.sval,      
/* schema path */
                                  
l->h->next->next->next->next->next->next->data.l_val, /* max memory */
-                                 
l->h->next->next->next->next->next->next->next->data.i_val,   /* max workers */
-                                 
l->h->next->next->next->next->next->next->next->next->data.i_val,     /* wlc */
-                                 
l->h->next->next->next->next->next->next->next->next->next->data.sval, /* 
optimizer */
-                                 
l->h->next->next->next->next->next->next->next->next->next->next->data.sval); 
/* default role */
+                                 
l->h->next->next->next->next->next->next->next->data.i_val, /* max workers */
+                                 
l->h->next->next->next->next->next->next->next->next->data.sval, /* optimizer */
+                                 
l->h->next->next->next->next->next->next->next->next->next->data.sval); /* 
default role */
        }       break;
        case SQL_DROP_USER:
                ret = rel_schema2(sql->sa, ddl_drop_user, s->data.sval, NULL, 
0);
diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -611,7 +611,6 @@ int yydebug=1;
        opt_work
        set_distinct
        tz
-    opt_wlc
 
 %right <sval> STRING USTRING XSTRING
 %right <sval> X_BODY
@@ -717,7 +716,7 @@ SQLCODE SQLERROR UNDER WHENEVER
 %token OVER PARTITION CURRENT EXCLUDE FOLLOWING PRECEDING OTHERS TIES RANGE 
UNBOUNDED GROUPS WINDOW
 
 %token X_BODY 
-%token MAX_MEMORY MAX_WORKERS WLC OPTIMIZER
+%token MAX_MEMORY MAX_WORKERS OPTIMIZER
 %%
 
 sqlstmt:
@@ -1481,7 +1480,7 @@ role_def:
          append_string(l, $2);
          append_int(l, $3);
          $$ = _symbol_create_list( SQL_CREATE_ROLE, l ); }
- |  USER ident WITH opt_encrypted PASSWORD string sqlNAME string SCHEMA ident 
user_schema_path opt_max_memory opt_max_workers opt_wlc opt_optimizer 
opt_default_role
+ |  USER ident WITH opt_encrypted PASSWORD string sqlNAME string SCHEMA ident 
user_schema_path opt_max_memory opt_max_workers opt_optimizer opt_default_role
        { dlist *l = L();
          append_string(l, $2);
          append_string(l, $6);
@@ -1491,9 +1490,8 @@ role_def:
          append_int(l, $4);
       append_lng(l, $12);
       append_int(l, $13);
-      append_int(l, $14);
+         append_string(l, $14);
          append_string(l, $15);
-         append_string(l, $16);
          $$ = _symbol_create_list( SQL_CREATE_USER, l ); }
  ;
 
@@ -1506,11 +1504,6 @@ opt_max_workers:
     /* empty */         { $$ = 0; }
  |  MAX_WORKERS posint  { $$ = $2; }
  ;
-
-opt_wlc:
-    /* empty */         { $$ = TRUE; }
- |  NO WLC              { $$ = FALSE; }
- ;
     
 opt_optimizer:
     /* empty */         { $$ = NULL; }
diff --git a/sql/server/sql_privileges.c b/sql/server/sql_privileges.c
--- a/sql/server/sql_privileges.c
+++ b/sql/server/sql_privileges.c
@@ -775,7 +775,7 @@ mvc_set_schema(mvc *m, char *schema)
 }
 
 char *
-sql_create_user(mvc *sql, char *user, char *passwd, char enc, char *fullname, 
char *schema, char *schema_path, lng max_memory, int max_workers, bool wlc, 
char *optimizer, char *role)
+sql_create_user(mvc *sql, char *user, char *passwd, char enc, char *fullname, 
char *schema, char *schema_path, lng max_memory, int max_workers, char 
*optimizer, char *role)
 {
        char *err;
        sql_schema *s = NULL;
@@ -801,7 +801,7 @@ sql_create_user(mvc *sql, char *user, ch
                throw(SQL, "sql.create_user", SQLSTATE(HY013) MAL_MALLOC_FAIL);
 
        if ((err = backend_create_user(sql, user, passwd, enc, fullname, 
schema_id, schema_path, sql->user_id, max_memory,
-                                       max_workers, wlc, optimizer, role_id)) 
!= NULL)
+                                       max_workers, optimizer, role_id)) != 
NULL)
        {
                /* strip off MAL exception decorations */
                char *r;
diff --git a/sql/server/sql_privileges.h b/sql/server/sql_privileges.h
--- a/sql/server/sql_privileges.h
+++ b/sql/server/sql_privileges.h
@@ -40,7 +40,7 @@ extern char *sql_revoke_role(mvc *m, str
 extern int sql_create_privileges(mvc *m, sql_schema *s);
 extern int sql_schema_has_user(mvc *m, sql_schema *s);
 
-extern char * sql_create_user(mvc *sql, char *user, char *passwd, char enc, 
char *fullname, char *schema, char *schema_path, lng max_memory, int 
max_workers, bool wlc, char *optimizer, char *default_role);
+extern char * sql_create_user(mvc *sql, char *user, char *passwd, char enc, 
char *fullname, char *schema, char *schema_path, lng max_memory, int 
max_workers, char *optimizer, char *default_role);
 extern char * sql_drop_user(mvc *sql, char *user);
 extern char * sql_alter_user(mvc *sql, char *user, char *passwd, char enc, 
char *schema, char *schema_path, char *oldpasswd);
 extern char * sql_rename_user(mvc *sql, char *olduser, char *newuser);
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to