Update of /cvsroot/monetdb/sql/src/server
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6882/server
Modified Files:
Tag: Aug2009
sql_schema.mx
Log Message:
protect against schema changes in readonly mode.
added test
U sql_schema.mx
Index: sql_schema.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_schema.mx,v
retrieving revision 1.177.2.2
retrieving revision 1.177.2.3
diff -u -d -r1.177.2.2 -r1.177.2.3
--- sql_schema.mx 16 Aug 2009 14:22:25 -0000 1.177.2.2
+++ sql_schema.mx 20 Sep 2009 19:39:36 -0000 1.177.2.3
@@ -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