Update of /cvsroot/monetdb/sql/src/storage/bat
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9464/src/storage/bat

Modified Files:
        bat_store.mx 
Log Message:
propagated changes of Thursday Jun 28 2007 - Sunday Jul 01 2007
from the SQL_2-18 branch to the development trunk

NOTE:

I hope, I resolved the conflicts in 

        src/backends/monet4/sql_server.mx
        src/backends/monet5/sql.mx
        src/backends/monet5/sql_optimizer.mx
        src/test/Dependencies/Tests/Dependencies.stable.out

correctly --- please double-check!



Index: bat_store.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_store.mx,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- bat_store.mx        29 Jun 2007 11:29:10 -0000      1.141
+++ bat_store.mx        1 Jul 2007 14:34:37 -0000       1.142
@@ -4033,6 +4033,23 @@
 {
        int ok = LOG_OK;
 
+       if (isTempSchema(fs)) {
+               if (fs->tables.set) {
+                       node *n;
+                       for (n = fs->tables.set->h; n; n = n->next) {
+                               sql_table *t = n->data;
+       
+                               if ((isTable(t) && isGlobalTable(t)) || 
+                                   t->commit_action == CA_DELETE) {
+                                       sql_trans_clear_table(tr, t);
+                               } else if (t->commit_action == CA_DROP) {
+                                       sql_trans_drop_table(tr, t->s, 
t->base.id, DROP_RESTRICT);
+                               }
+                       }
+               }
+               return ok;
+       }
+
        if (ok == LOG_OK)
                ok = rollforward_changeset_updates(tr, &fs->types, &ts->types, 
&ts->base, (rfufunc) NULL, (rfcfunc) &rollforward_create_type, (rfdfunc) NULL, 
(dupfunc) &type_dup);
 
@@ -4365,9 +4382,27 @@
 static int
 reset_schema(sql_trans *tr, sql_schema *fs, sql_schema *pfs)
 {
+       int ok = LOG_OK;
+
+       if (isTempSchema(fs)) {
+               if (fs->tables.set) {
+                       node *n;
+                       for (n = fs->tables.set->h; n; n = n->next) {
+                               sql_table *t = n->data;
+       
+                               if ((isTable(t) && isGlobalTable(t)) || 
+                                    t->commit_action == CA_DELETE) {
+                                       sql_trans_clear_table(tr, t);
+                               } else if (t->commit_action == CA_DROP) {
+                                       sql_trans_drop_table(tr, t->s, 
t->base.id, DROP_RESTRICT);
+                               }
+                       }
+               }
+               return ok;
+       }
+
        /* did we make changes or is the global changed after we started */
        if (fs->base.wtime || tr->stime < pfs->base.wtime) {
-               int ok = LOG_OK;
                fs->base.wtime = fs->base.rtime = 0;
 
                ok = reset_changeset(tr, &fs->types, &pfs->types, &fs->base, 
(resetf) &reset_type, (dupfunc) &type_dup);
@@ -4380,7 +4415,7 @@
                if (ok == LOG_OK)
                        return reset_changeset(tr, &fs->tables, &pfs->tables, 
&fs->base, (resetf) &reset_table, (dupfunc) &table_dup);
        }
-       return LOG_OK;
+       return ok;
 }
 
 static int
@@ -4438,7 +4473,8 @@
                        sql_schema *s = n->data;
                        sql_schema *os;
 
-                       if (strcmp(s->base.name,"tmp") == 0)
+                       
+                       if (isTempSchema(s))
                                continue;
 
                        os = find_sql_schema(tr->parent, s->base.name);


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to