Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14129

Modified Files:
        database.c database.h monetdb.c monetdb.1 
Log Message:
always put created databases under maintenance

this simplifies some things, but also makes sense, because in a real
life scenario, it's never a good thing when a freshly created database
can be started by any arbitrary client (it is not initialised, has
default passwords, etc.)


U database.c
Index: database.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/database.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- database.c  20 Aug 2009 11:38:29 -0000      1.2
+++ database.c  20 Aug 2009 12:04:56 -0000      1.3
@@ -36,7 +36,7 @@
        'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
        '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};
 
-char* db_create(char *dbfarm, char* dbname, char maintenance) {
+char* db_create(char *dbfarm, char* dbname) {
        sabdb *stats;
        char* e;
        size_t c;
@@ -102,11 +102,10 @@
                                "filenames inside would get truncated"));
        }
 
-       /* if we should put this database in maintenance, make sure
-        * no race condition ever can happen, by putting it into
-        * maintenance before it even exists for Merovingian */
-       if (maintenance == 1)
-               fclose(fopen(path, "w"));
+       /* put this database under maintenance, make sure no race condition
+        * ever can happen, by putting it under maintenance before it even
+        * exists for Merovingian */
+       fclose(fopen(path, "w"));
 
        /* avoid GDK making fugly complaints */
        snprintf(path, sizeof(path), "%s/%s/.gdk_lock", dbfarm, dbname);

U monetdb.1
Index: monetdb.1
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb.1,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- monetdb.1   2 Jul 2009 11:57:00 -0000       1.7
+++ monetdb.1   20 Aug 2009 12:04:56 -0000      1.8
@@ -1,7 +1,7 @@
 .\" Process this file with
 .\" groff -man -Tascii foo.1
 .\"
-.TH MONETDB 1 "JUNE 2009" Application "MonetDB Applications"
+.TH MONETDB 1 "AUGUST 2009" Application "MonetDB Applications"
 .SH NAME
 monetdb \- control a MonetDB Database Server instance
 .SH SYNOPSIS
@@ -20,19 +20,14 @@
 .BR create ", " destroy ", " lock ", " release ", " status ", " start ", " 
stop ", " kill ", " set ", " get ", " inherit ", " discover ", " help ", " 
version .
 The commands facilitate adding, removing, maintaining, starting and
 stopping a database inside the MonetDB Database Server.
-.IP "create [\-l] database [database ...]"
+.IP "create database [database ...]"
 Initialises a new database in the MonetDB Database Server.  A database
-created with this command makes it available for use by clients under
-its database name.  The name of the database must match the expression
-[A\-Za\-z0\-9\-_]+.
-.IP "  \-l"
-The
-.I \-l
-(lock) option, puts the database in maintenance mode directly after
-its creation.  A database created like this is guaranteed not to be
-automatically started by
-.BR merovingian (1)
-upon a client request during its creation time.
+created with this command makes it available under its database name,
+but not yet for use by clients, as the database is put into maintenance
+mode.  This allows the database administrator to perform initialisation
+steps before releasing it to users.  See also
+.BR "monetdb lock" .
+The name of the database must match the expression [A\-Za\-z0\-9\-_]+.
 .IP "destroy [\-f] database [database ...]"
 Removes the given database, including all its data and logfiles.  Once
 destroy has completed, all data is lost.  Be careful when using this

U monetdb.c
Index: monetdb.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- monetdb.c   20 Aug 2009 11:38:29 -0000      1.31
+++ monetdb.c   20 Aug 2009 12:04:56 -0000      1.32
@@ -89,12 +89,10 @@
                printf("    discover, help, version\n");
                printf("  use the help command to get help for a particular 
command\n");
        } else if (strcmp(argv[1], "create") == 0) {
-               printf("Usage: monetdb create [-l] database [database ...]\n");
+               printf("Usage: monetdb create database [database ...]\n");
                printf("  Initialises a new database in the MonetDB Server.  
A\n");
                printf("  database created with this command makes it 
available\n");
-               printf("  for use.\n");
-               printf("Options:\n");
-               printf("  -l  put the database in maintenance mode after 
creation\n");
+               printf("  for use, however in maintenance mode (see monetdb 
lock).\n");
        } else if (strcmp(argv[1], "destroy") == 0) {
                printf("Usage: monetdb destroy [-f] database [database ...]\n");
                printf("  Removes the given database, including all its data 
and\n");
@@ -190,7 +188,6 @@
 command_create(int argc, char *argv[])
 {
        int i;
-       int maintenance = 0;  /* create locked database */
        int state = 0;        /* return status */
        int hadwork = 0;      /* if we actually did something */
 
@@ -207,14 +204,9 @@
                        break;
                }
                if (argv[i][0] == '-') {
-                       if (argv[i][1] == 'l') {
-                               maintenance = 1;
-                               argv[i] = NULL;
-                       } else {
-                               fprintf(stderr, "create: unknown option: %s\n", 
argv[i]);
-                               command_help(argc + 1, &argv[-1]);
-                               exit(1);
-                       }
+                       fprintf(stderr, "create: unknown option: %s\n", 
argv[i]);
+                       command_help(argc + 1, &argv[-1]);
+                       exit(1);
                }
        }
 
@@ -225,11 +217,11 @@
                if (argv[i] == NULL)
                        continue;
 
-               ret = db_create(dbfarm, argv[i], maintenance);
+               ret = db_create(dbfarm, argv[i]);
 
                if (ret == NULL) {
-                       printf("successfully created database '%s'%s\n", 
argv[i],
-                                       (maintenance == 1 ? " in maintenance 
mode" : ""));
+                       printf("successfully created database '%s' "
+                                       "in maintenance mode\n", argv[i]);
                } else {
                        fprintf(stderr, "create: %s\n", ret);
                        free(ret);

U database.h
Index: database.h
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/database.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- database.h  20 Aug 2009 11:38:29 -0000      1.2
+++ database.h  20 Aug 2009 12:04:56 -0000      1.3
@@ -20,7 +20,7 @@
 #ifndef _SEEN_DATABASE_H
 #define _SEEN_DATABASE_H 1
 
-char* db_create(char *dbfarm, char* dbname, char maintenance);
+char* db_create(char *dbfarm, char* dbname);
 char* db_destroy(char* dbname);
 
 #endif


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to