Changeset: 5a6c83e64a05 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a6c83e64a05
Modified Files:
        sql/backends/monet5/sql.mx
Branch: SciQL-2
Log Message:

enforce using correct syntax: don't allow dropping arrays with DROP TABLE, and 
vice versa


diffs (15 lines):

diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -2188,7 +2188,10 @@ drop_table(mvc *sql, char *sname, char *
                return sql_message("42000!DROP %s: cannot drop system %s '%s'", 
(tt==tt_table)?"TABLE":"ARRAY", (tt==tt_table)?"table":"array", tname);
        } else if (!schema_privs(sql->role_id, s) && !(isTempSchema(s) && 
t->persistence == SQL_LOCAL_TEMP)){
                return sql_message("42000!DROP %s: access denied for %s to 
schema ;'%s'", (tt==tt_table)?"TABLE":"ARRAY", stack_get_string(sql, 
"current_user"), s->base.name);
-       }
+       } else if ((tt == tt_table && t->valence > 0) || (tt == tt_array && 
t->valence == 0)) {
+               return sql_message("42S02!DROP %s: '%s' is %s not %s, ", 
(tt==tt_table)?"TABLE":"ARRAY", tname, (tt==tt_table)?"an array":"a table", 
(tt==tt_table)?"a table":"an array");
+       }
+
        if ( !drop_action && t->keys.set) {
                for (n = t->keys.set->h; n; n = n->next) {
                        sql_key *k = n->data;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to