Changeset: 29de703edd1d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=29de703edd1d
Modified Files:
        
Branch: default
Log Message:

Merge with Oct2010 branch.


diffs (172 lines):

diff -r 5e6213957b6c -r 29de703edd1d clients/src/mapiclient/dump.c
--- a/clients/src/mapiclient/dump.c     Wed Sep 08 22:41:12 2010 +0200
+++ b/clients/src/mapiclient/dump.c     Thu Sep 09 13:06:36 2010 +0200
@@ -170,7 +170,8 @@
                              "\"fkk\".\"rkey\" = \"pkk\".\"id\" AND "
                              "\"fkkc\".\"nr\" = \"pkkc\".\"nr\" AND "
                              "\"pkt\".\"schema_id\" = \"ps\".\"id\" AND "
-                             "\"fkt\".\"schema_id\" = \"fs\".\"id\" "
+                             "\"fkt\".\"schema_id\" = \"fs\".\"id\" AND "
+                             "\"fkt\".\"system\" = FALSE "
                        "ORDER BY \"fs\".\"name\",\"fkt\".\"name\","
                              "\"fkk\".\"name\", \"nr\"";
        }
@@ -1426,3 +1427,43 @@
                mapi_close_handle(hdl);
        return 1;
 }
+
+void
+dump_version(Mapi mid, stream *toConsole, const char *prefix)
+{
+       MapiHdl hdl;
+       char *dbname = NULL, m5ver[24];
+       char *name, *val;
+
+       if ((hdl = mapi_query(mid,
+                             "SELECT \"name\", \"value\" "
+                             "FROM sys.env() AS env "
+                             "WHERE \"name\" IN ('gdk_dbname', 
'monet_version')")) == NULL ||
+           mapi_error(mid))
+               goto cleanup;
+
+       m5ver[0] = '\0';
+       while ((mapi_fetch_row(hdl)) != 0) {
+               name = mapi_fetch_field(hdl, 0);
+               val = mapi_fetch_field(hdl, 1);
+
+               if (mapi_error(mid))
+                       goto cleanup;
+
+               if (name != NULL && val != NULL) {
+                       if (strcmp(name, "gdk_dbname") == 0)
+                               dbname = strdup(val);
+                       else if (strcmp(name, "monet_version") == 0)
+                               snprintf(m5ver, sizeof(m5ver), "%s", val);
+               }
+       }
+       if (dbname != NULL && *dbname != '\0' && m5ver[0] != '\0')
+               mnstr_printf(toConsole, "%s MonetDB v%s, '%s'\n",
+                            prefix, m5ver, dbname);
+
+  cleanup:
+       if (dbname != NULL)
+               free(dbname);
+       if (hdl)
+               mapi_close_handle(hdl);
+}
diff -r 5e6213957b6c -r 29de703edd1d clients/src/mapiclient/mclient.c
--- a/clients/src/mapiclient/mclient.c  Wed Sep 08 22:41:12 2010 +0200
+++ b/clients/src/mapiclient/mclient.c  Thu Sep 09 13:06:36 2010 +0200
@@ -2654,7 +2654,6 @@
 
        /* give the user a welcome message with some general info */
        if ((interactive || (!has_fileargs && command == NULL)) && 
interactive_stdin) {
-               MapiHdl hdl;
                char *lang;
 
                switch (mode) {
@@ -2674,32 +2673,9 @@
                              "interactive terminal (%s)\n",
                              lang, MONETDB_RELEASE);
 
-               if (mode == SQL &&
-                   (hdl = mapi_query(mid,
-                                     "SELECT \"name\", \"value\" "
-                                     "FROM sys.env() AS env "
-                                     "WHERE \"name\" IN ('gdk_dbname', 
'monet_version')")) != NULL &&
-                   mapi_error(mid) == MOK) {
-                       char *dbname = NULL, m5ver[24];
-                       char *name, *val;
-                       m5ver[0] = '\0';
-                       while (fetch_row(hdl) == 2) {
-                               name = mapi_fetch_field(hdl, 0);
-                               val = mapi_fetch_field(hdl, 1);
-                               if (name != NULL && val != NULL) {
-                                       if (strcmp(name, "gdk_dbname") == 0) {
-                                               dbname = strdup(val);
-                                       } else if (strcmp(name, 
"monet_version") == 0) {
-                                               snprintf(m5ver, sizeof(m5ver), 
"%s", val);
-                                       }
-                               }
-                       }
-                       mapi_close_handle(hdl);
-                       if (dbname != NULL && *dbname != '\0' && m5ver[0] != 
'\0')
-                               mnstr_printf(toConsole, "Database: MonetDB v%s, 
'%s'\n", m5ver, dbname);
-                       if (dbname != NULL)
-                               free(dbname);
-               }
+               if (mode == SQL)
+                       dump_version(mid, toConsole, "Database:");
+
                mnstr_printf(toConsole, "Type \\q to quit, \\? for a list of 
available commands\n");
                if (mode == SQL)
                        mnstr_printf(toConsole, "auto commit mode: on\n");
diff -r 5e6213957b6c -r 29de703edd1d clients/src/mapiclient/msqldump.c
--- a/clients/src/mapiclient/msqldump.c Wed Sep 08 22:41:12 2010 +0200
+++ b/clients/src/mapiclient/msqldump.c Thu Sep 09 13:06:36 2010 +0200
@@ -232,20 +232,25 @@
        mapi_cache_limit(mid, 10000);
 
        out = file_wastream(stdout, "stdout");
-       if ( out ) {
-               char buf[27]="unknown date";
+       if (!quiet) {
+               char buf[27];
                time_t t = time(0);
+               char *p;
+
 #ifdef HAVE_CTIME_R3
-        ctime_r(&t, buf, sizeof(buf));
+               ctime_r(&t, buf, sizeof(buf));
 #else
 #ifdef HAVE_CTIME_R
-        ctime_r(&t, buf);
+               ctime_r(&t, buf);
 #else
-        strncpy(buf, ctime(&t), sizeof(buf));
+               strncpy(buf, ctime(&t), sizeof(buf));
 #endif
 #endif
-
-               mnstr_printf(out,"#msqldump %s %s\n", (functions? 
"functions":"tables"), buf);
+               if ((p = strrchr(buf, '\n')) != NULL)
+                       *p = 0;
+               mnstr_printf(out,"-- msqldump %s %s\n",
+                            functions ? "functions" : "tables", buf);
+               dump_version(mid, out, "--");
        }
        if (functions)
                c = dump_functions(mid, out, NULL);
diff -r 5e6213957b6c -r 29de703edd1d clients/src/mapiclient/msqldump.h
--- a/clients/src/mapiclient/msqldump.h Wed Sep 08 22:41:12 2010 +0200
+++ b/clients/src/mapiclient/msqldump.h Thu Sep 09 13:06:36 2010 +0200
@@ -22,3 +22,4 @@
 extern int dump_table(Mapi mid, char *schema, char *tname, stream *toConsole, 
int describe, int foreign);
 extern int dump_functions(Mapi mid, stream *toConsole, const char *sname);
 extern int dump_tables(Mapi mid, stream *toConsole, int describe);
+extern void dump_version(Mapi mid, stream *toConsole, const char *prefix);
diff -r 5e6213957b6c -r 29de703edd1d testing/src/Mtest.py.in
--- a/testing/src/Mtest.py.in   Wed Sep 08 22:41:12 2010 +0200
+++ b/testing/src/Mtest.py.in   Thu Sep 09 13:06:36 2010 +0200
@@ -3008,7 +3008,7 @@
         dft['MILCLIENT']      = "'mclient -lmil -ftest'"
         dft['MALCLIENT']      = "'mclient -lmal -ftest'"
         dft['SQLCLIENT']      = "'mclient -lsql -ftest'"
-        dft['SQLDUMP']        = "'msqldump'"
+        dft['SQLDUMP']        = "'msqldump -q'"
         dft['XQUERYCLIENT']   = "'mclient -lxquery -fxml'"
 
     #par = {}
diff -r 5e6213957b6c -r 29de703edd1d testing/src/process.py
--- a/testing/src/process.py    Wed Sep 08 22:41:12 2010 +0200
+++ b/testing/src/process.py    Thu Sep 09 13:06:36 2010 +0200
@@ -42,7 +42,7 @@
 _mal_client = splitcommand(os.getenv('MAL_CLIENT', 'mclient -lmal'))
 _sql_client = splitcommand(os.getenv('SQL_CLIENT', 'mclient -lsql'))
 _xquery_client = splitcommand(os.getenv('XQUERY_CLIENT', 'mclient -lxquery 
-fxml'))
-_sql_dump = splitcommand(os.getenv('SQL_DUMP', 'msqldump'))
+_sql_dump = splitcommand(os.getenv('SQL_DUMP', 'msqldump -q'))
 _server = splitcommand(os.getenv('MSERVER', ''))
 
 _dotmonetdbfile = []
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to