Changeset: 802f17b3dc42 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=802f17b3dc42
Modified Files:
        clients/mapiclient/dump.c
Branch: Mar2018
Log Message:

When dumping a view definition also dump comments on the view columns.
Moving the code for dumping column comments to outside the case it was not a 
view.


diffs (39 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -947,21 +947,22 @@ describe_table(Mapi mid, const char *sch
                }
                mapi_close_handle(hdl);
                hdl = NULL;
-               snprintf(query, maxquerylen,
-                        "SELECT col.name, com.remark FROM sys._columns col, 
sys.comments com WHERE col.id = com.id AND col.table_id = (SELECT id FROM 
sys._tables WHERE schema_id = (SELECT id FROM sys.schemas WHERE name = '%s') 
AND name = '%s') ORDER BY number", schema, tname);
-               if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
-                       goto bailout;
-               while (mapi_fetch_row(hdl) != 0) {
-                       comment_on(toConsole, "COLUMN", schema, tname,
-                                  mapi_fetch_field(hdl, 0),
-                                  mapi_fetch_field(hdl, 1));
-               }
-               mapi_close_handle(hdl);
-               hdl = NULL;
-               if (mapi_error(mid))
-                       goto bailout;
        }
 
+       snprintf(query, maxquerylen,
+                "SELECT col.name, com.remark FROM sys._columns col, 
sys.comments com WHERE col.id = com.id AND col.table_id = (SELECT id FROM 
sys._tables WHERE schema_id = (SELECT id FROM sys.schemas WHERE name = '%s') 
AND name = '%s') ORDER BY number", schema, tname);
+       if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
+               goto bailout;
+       while (mapi_fetch_row(hdl) != 0) {
+               comment_on(toConsole, "COLUMN", schema, tname,
+                          mapi_fetch_field(hdl, 0),
+                          mapi_fetch_field(hdl, 1));
+       }
+       mapi_close_handle(hdl);
+       hdl = NULL;
+       if (mapi_error(mid))
+               goto bailout;
+
        if (view)
                free(view);
        if (remark)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to