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

merged from Oct2010


diffs (62 lines):

diff -r 0bed78c83f84 -r 262dcfd586a9 clients/ChangeLog.Oct2010
--- a/clients/ChangeLog.Oct2010 Thu Oct 28 14:34:50 2010 +0200
+++ b/clients/ChangeLog.Oct2010 Thu Oct 28 15:33:06 2010 +0200
@@ -1,6 +1,9 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Thu Oct 28 2010 Fabian Groffen <[email protected]>
+- Fix crash when the server disconnects during \d query
+
 * Wed Oct 27 2010 Sjoerd Mullender <[email protected]>
 - A manual page for the msqldump program was added.
 - Mclient now recognizes the file name "-" to refer to its standard
diff -r 0bed78c83f84 -r 262dcfd586a9 clients/src/mapiclient/mclient.c
--- a/clients/src/mapiclient/mclient.c  Thu Oct 28 14:34:50 2010 +0200
+++ b/clients/src/mapiclient/mclient.c  Thu Oct 28 15:33:06 2010 +0200
@@ -1959,26 +1959,25 @@
 #endif
                                        } else {
                                                /* get all table names in 
current schema */
-                                               if ((hdl = mapi_query(mid,
-                                                                     "SELECT 
\"t\".\"name\", \"t\".\"type\", "
-                                                                     
"\"s\".\"name\" "
-                                                                     "FROM 
\"sys\".\"_tables\" \"t\", "
-                                                                     
"\"sys\".\"schemas\" \"s\" "
-                                                                     "WHERE 
\"t\".\"schema_id\" = \"s\".\"id\" "
-                                                                     "AND 
\"s\".\"name\" = \"current_schema\" "
-                                                                     "AND 
\"t\".\"system\" = false "
-                                                                     "ORDER BY 
\"t\".\"name\"")) != NULL &&
-                                                   mapi_error(mid) == MOK) {
-                                                       char *type, *name, 
*schema;
-                                                       while (fetch_row(hdl) 
== 3) {
-                                                               name = 
mapi_fetch_field(hdl, 0);
-                                                               type = 
mapi_fetch_field(hdl, 1);
-                                                               schema = 
mapi_fetch_field(hdl, 2);
-                                                               
mnstr_printf(toConsole,
-                                                                             
"%-6s  %s.%s\n",
-                                                                             
*type == '1' ? "VIEW" : "TABLE",
-                                                                             
schema, name);
-                                                       }
+                                               char *type, *name, *schema;
+                                               hdl = mapi_query(mid,
+                                                               "SELECT 
\"t\".\"name\", \"t\".\"type\", "
+                                                               "\"s\".\"name\" 
"
+                                                               "FROM 
\"sys\".\"_tables\" \"t\", "
+                                                               
"\"sys\".\"schemas\" \"s\" "
+                                                               "WHERE 
\"t\".\"schema_id\" = \"s\".\"id\" "
+                                                               "AND 
\"s\".\"name\" = \"current_schema\" "
+                                                               "AND 
\"t\".\"system\" = false "
+                                                               "ORDER BY 
\"t\".\"name\"");
+                                               CHECK_RESULT(mid, hdl, buf, 
continue);
+                                               while (fetch_row(hdl) == 3) {
+                                                       name = 
mapi_fetch_field(hdl, 0);
+                                                       type = 
mapi_fetch_field(hdl, 1);
+                                                       schema = 
mapi_fetch_field(hdl, 2);
+                                                       mnstr_printf(toConsole,
+                                                                         "%-6s 
 %s.%s\n",
+                                                                         *type 
== '1' ? "VIEW" : "TABLE",
+                                                                         
schema, name);
                                                }
                                                mapi_close_handle(hdl);
                                                hdl = NULL;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to