Changeset: fc1d11e132eb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc1d11e132eb
Modified Files:
        sql/backends/monet5/sql_cat.c
        sql/server/rel_select.c
Branch: Jul2017
Log Message:

partial fix of bug 6436 (ie do not overwrite the argument list of a function 
description)
fix bug 6437, ie do not drop systems schemas (later we should remove the system 
flag from the bam schema)


diffs (47 lines):

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
@@ -871,7 +871,7 @@ SQLdrop_schema(Client cntxt, MalBlkPtr m
                msg = sql_message("42000!DROP SCHEMA: access denied for %s to 
schema ;'%s'", stack_get_string(sql, "current_user"), s->base.name);
        } else if (s == cur_schema(sql)) {
                msg = sql_message("42000!DROP SCHEMA: cannot drop current 
schema");
-       } else if (strcmp(sname, "sys") == 0 || strcmp(sname, "tmp") == 0) {
+       } else if (s->system) {
                msg = sql_message("42000!DROP SCHEMA: access denied for '%s'", 
sname);
        } else if (sql_schema_has_user(sql, s)) {
                msg = sql_message("2BM37!DROP SCHEMA: unable to drop schema 
'%s' (there are database objects which depend on it", sname);
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -488,12 +488,13 @@ find_table_function(mvc *sql, sql_schema
                                for (n = exps->h, m = sf->func->ops->h; n && m; 
n = n->next, m = m->next) {
                                        sql_arg *a = m->data;
                                        sql_exp *e = n->data;
+                                       sql_subtype anytype = a->type;
 
                                        if (a->type.type->eclass == EC_ANY) {
                                                sql_subtype *st = &e->tpe;
-                                               sql_init_subtype(&a->type, 
st->type, st->digits, st->scale);
+                                               sql_init_subtype(&anytype, 
st->type, st->digits, st->scale);
                                        }
-                                       e = rel_check_type(sql, &a->type, e, 
type_equal);
+                                       e = rel_check_type(sql, &anytype, e, 
type_equal);
                                        if (!e) {
                                                nexps = NULL;
                                                break;
@@ -1818,12 +1819,13 @@ static sql_exp*
                                        n = n->next, m = m->next) {
                                sql_arg *a = m->data;
                                sql_exp *e = n->data;
+                               sql_subtype anytype = a->type;
 
                                if (a->type.type->eclass == EC_ANY) {
                                        sql_subtype *st = &e->tpe;
-                                       sql_init_subtype(&a->type, st->type, 
st->digits, st->scale);
+                                       sql_init_subtype(&anytype, st->type, 
st->digits, st->scale);
                                }
-                               e = rel_check_type(sql, &a->type, e, 
type_equal);
+                               e = rel_check_type(sql, &anytype, e, 
type_equal);
                                if (!e) {
                                        nexps = NULL;
                                        break;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to