Update of /cvsroot/monetdb/sql/src/server
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16797/src/server
Modified Files:
sql_schema.mx
Log Message:
propagated changes of Sunday Sep 20 2009 - Monday Sep 21 2009
from the Aug2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/20 - nielsnes: src/server/sql_schema.mx,1.177.2.3
protect against schema changes in readonly mode.
added test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: sql_schema.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_schema.mx,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- sql_schema.mx 17 Aug 2009 10:54:11 -0000 1.179
+++ sql_schema.mx 21 Sep 2009 14:13:44 -0000 1.180
@@ -2007,12 +2007,14 @@
{
stmt *ret = NULL;
- /* TODO everything should be done via the backend language */
if (!QUERY_MODE(sql->emode))
return sql_error(sql, 05, "schema statements are directly
executed "
"and therefore cannot be debugged, explained,
profiled, "
"traced or used in a prepared statement");
+ if (s->token != SQL_CREATE_TABLE && STORE_READONLY(active_store_type))
+ return sql_error(sql, 06, "schema statements cannot be executed
on a readonly database.");
+
switch (s->token) {
case SQL_CREATE_SCHEMA:
{
@@ -2060,6 +2062,8 @@
assert(l->h->type == type_int);
assert(l->h->next->next->next->type == type_int);
+ if (!l->h->data.i_val && STORE_READONLY(active_store_type))
+ return sql_error(sql, 06, "schema statements cannot be
executed on a readonly database.");
ret = sql_create_table(sql, cur_schema(sql), l->h->data.i_val,
sname, name, l->h->next->next->data.sym, l->h->next->next->next->data.i_val);
sql->type = Q_SCHEMA;
}
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins