Update of /cvsroot/monetdb/sql/src/server
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3292/src/server

Modified Files:
        sql_schema.mx 
Log Message:
propagated changes of Saturday Aug 30 2008 - Tuesday Sep 02 2008
from the SQL_2-24 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/08/30 - nielsnes: src/server/sql_schema.mx,1.140.2.5
added dynamic type checks in more cases (fixes 
auto_coersion_bug.SF-2075157.sql,string_length_not_checked.SF-2075078.sql)
added checks in alter table (fixes alter_view_not_allowed.SF-2075195.sql)
fixed hanling of not in (fixes select_in_wrong_result.SF-2080168.sql)
use the new thetauselect (fixes select_not_wrong_result.SF-2080151.sql)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: sql_schema.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_schema.mx,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- sql_schema.mx       25 Aug 2008 13:36:16 -0000      1.147
+++ sql_schema.mx       2 Sep 2008 13:21:15 -0000       1.148
@@ -1277,6 +1277,9 @@
        dlist *opt_list = NULL;
        stmt *res = NULL;
 
+       if (alter && !isTable(t)) {
+               return sql_error(sql, 02, "ALTER TABLE: cannot add column to 
VIEW '%s'\n", t->base.name);
+       }
        if (l->h->next->next)
                opt_list = l->h->next->next->data.lval;
 
@@ -1409,9 +1412,6 @@
 {
        stmt *res = NULL;
 
-       if (!isTable(t)) {
-               return sql_error(sql, 02, "ALTER TABLE: cannot add constraint 
to VIEW '%s'\n", t->base.name);
-       }
        if (isTempTable(t))
                return sql_error(sql, 02, "CONSTRAINT: constraints on temporary 
tables are not supported\n");
        switch (s->token) {
@@ -1482,6 +1482,35 @@
 {
        stmt *res = NULL;
 
+       if (alter && !isTable(t)) {
+               char *msg = "";
+
+               switch (s->token) {
+               case SQL_COLUMN:        
+                       msg = "add column to"; 
+                       break;
+               case SQL_CONSTRAINT:    
+                       msg = "add constraint to"; 
+                       break;
+               case SQL_COLUMN_OPTIONS:
+               case SQL_DEFAULT:
+               case SQL_NOT_NULL:
+               case SQL_NULL:
+                       msg = "set column options for"; 
+                       break;
+               case SQL_DROP_DEFAULT:
+                       msg = "drop default column option from"; 
+                       break;
+               case SQL_DROP_COLUMN:
+                       msg = "drop column from"; 
+                       break;
+               case SQL_DROP_CONSTRAINT:
+                       msg = "drop constraint from"; 
+                       break;
+               }
+               return sql_error(sql, 02, "ALTER TABLE: cannot %s VIEW '%s'\n", 
                        msg, t->base.name);
+       }
+
        switch (s->token) {
        case SQL_COLUMN:
                res = create_column(sql, s, ss, t, alter);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to