Changeset: f1acf0cd2367 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f1acf0cd2367
Modified Files:
        sql/storage/store.c
Branch: Jun2020
Log Message:

When dropping a child table cascade, while dropping the parent, the child will 
be already deleted, so look in the cascade list


diffs (25 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -5416,15 +5416,16 @@ sys_drop_columns(sql_trans *tr, sql_tabl
 static void
 sys_drop_parts(sql_trans *tr, sql_table *t, int drop_action)
 {
-       node *n;
-
        if (cs_size(&t->members)) {
-               for (n = t->members.set->h; n; ) {
+               for (node *n = t->members.set->h; n; ) {
                        sql_part *pt = n->data;
-                       sql_table *tt = find_sql_table_id(t->s, pt->base.id);
 
                        n = n->next;
-                       sql_trans_del_table(tr, t, tt, drop_action);
+                       if ((drop_action == DROP_CASCADE_START || drop_action 
== DROP_CASCADE) &&
+                               tr->dropped && list_find_id(tr->dropped, 
pt->base.id))
+                               continue;
+
+                       sql_trans_del_table(tr, t, find_sql_table_id(t->s, 
pt->base.id), drop_action);
                }
        }
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to