Changeset: 06e7718261b8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=06e7718261b8
Modified Files:
        sql/src/backends/monet5/sql.mx
        sql/src/server/rel_updates.c
Branch: default
Log Message:

only allow copy .. locked and vacuum in auto commit mode.


diffs (32 lines):

diff -r 05a0ec5f0834 -r 06e7718261b8 sql/src/backends/monet5/sql.mx
--- a/sql/src/backends/monet5/sql.mx    Mon Dec 20 21:55:02 2010 +0100
+++ b/sql/src/backends/monet5/sql.mx    Tue Dec 21 09:20:17 2010 +0100
@@ -5145,9 +5145,11 @@
        if (m->user_id != USER_MONETDB)
                throw(MAL,"s...@1","insufficient privileges");
        if ((!list_empty(t->idxs.set) || !list_empty(t->keys.set)))
-               throw(MAL,"s...@1","vacuum not allowed on tables with indices");
+               throw(MAL,"s...@1","@1 not allowed on tables with indices");
        if (has_snapshots(m->session->tr)) 
-               throw(MAL,"s...@1","vacuum not allowed on snapshots");
+               throw(MAL,"s...@1","@1 not allowed on snapshots");
+       if (!m->session->auto_commit) 
+               throw(MAL,"s...@1","@1 only allowed in auto commit mode");
 
        /* lock the store, for single user/transaction */
        store_lock();
diff -r 05a0ec5f0834 -r 06e7718261b8 sql/src/server/rel_updates.c
--- a/sql/src/server/rel_updates.c      Mon Dec 20 21:55:02 2010 +0100
+++ b/sql/src/server/rel_updates.c      Tue Dec 21 09:20:17 2010 +0100
@@ -583,7 +583,10 @@
                    "COPY INTO from .. LOCKED requires tables without indices");
        }
        if (locked && has_snapshots(sql->session->tr)) {
-               return sql_error(sql, 02, "COPY INTO: not allowed on 
snapshots");
+               return sql_error(sql, 02, "COPY INTO .. LOCKED: not allowed on 
snapshots");
+       }
+       if (locked && !sql->session->auto_commit) {
+               return sql_error(sql, 02, "COPY INTO .. LOCKED: only allowed in 
auto commit mode");
        }
        /* lock the store, for single user/transaction */
        if (locked) { 
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to