Changeset: 15df7e6b4338 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=15df7e6b4338
Modified Files:
        sql/test/Dependencies/Tests/dependency_functions.sql
        sql/test/Dependencies/Tests/dependency_functions.test
        sql/test/miscellaneous/Tests/simple_selects.test
Branch: mtest
Log Message:

Merged with default


diffs (truncated from 130127 to 300 lines):

diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -80,9 +80,9 @@ def main():
                r'lib\MonetODBC.dll', # r'lib\MonetODBC.pdb',
                r'lib\MonetODBCs.dll', # r'lib\MonetODBCs.pdb',
                r'bin\stream.dll', # r'lib\stream.pdb',
-               vcpkg.format(r'bin\libiconv.dll'),
+               vcpkg.format(r'bin\iconv-2.dll'),
                vcpkg.format(r'bin\bz2.dll'),
-               vcpkg.format(r'bin\libcharset.dll'), # for libiconv.dll
+               vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll
                vcpkg.format(r'bin\libcrypto-1_1{}.dll'.format(libcrypto)),
                vcpkg.format(r'bin\zlib1.dll')])
     print(r'            </Directory>')
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -145,10 +145,10 @@ def main():
                r'bin\monetdb5.dll',
                r'bin\monetdbsql.dll',
                r'bin\stream.dll',
-               vcpkg.format(r'bin\libiconv.dll'),
+               vcpkg.format(r'bin\iconv-2.dll'),
                vcpkg.format(r'bin\bz2.dll'),
+               vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll
                vcpkg.format(r'bin\getopt.dll'),
-               vcpkg.format(r'bin\libcharset.dll'), # for libiconv.dll
                vcpkg.format(r'bin\libcrypto-1_1{}.dll'.format(libcrypto)),
                vcpkg.format(r'bin\libxml2.dll'),
                vcpkg.format(r'bin\lz4.dll'),
@@ -199,10 +199,10 @@ def main():
                r'lib\monetdb5.lib',
                r'lib\monetdbsql.lib',
                r'lib\stream.lib',
-               vcpkg.format(r'lib\libiconv.lib'),
+               vcpkg.format(r'lib\iconv.lib'),
                vcpkg.format(r'lib\bz2.lib'),
+               vcpkg.format(r'lib\charset.lib'),
                vcpkg.format(r'lib\getopt.lib'),
-               vcpkg.format(r'lib\libcharset.lib'),
                vcpkg.format(r'lib\libcrypto.lib'),
                vcpkg.format(r'lib\libxml2.lib'),
                vcpkg.format(r'lib\lz4.lib'),
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -46,76 +46,6 @@
 
 #include "msqldump.h"
 
-static const char *
-get_with_comments_as_clause(Mapi mid)
-{
-       const char *query = /* check whether sys.comments exists */
-               "SELECT t.id "
-               "FROM sys._tables t JOIN sys.schemas s ON t.schema_id = s.id "
-               "WHERE s.name = 'sys' AND t.name = 'comments'";
-       const char *new_clause =
-               "WITH comments AS (SELECT * FROM sys.comments), "
-                    "function_types AS (SELECT * FROM sys.function_types), "
-                    "function_languages AS (SELECT * FROM 
sys.function_languages)";
-       const char *old_clause =
-               "WITH comments AS ("
-                       "SELECT 42 AS id, 'no comment' AS remark WHERE FALSE"
-                    "), "
-                    "function_types AS ("
-                       "SELECT function_type_id, function_type_name, 
function_type_keyword "
-                       "FROM sys.function_types, "
-                            "(VALUES "
-                               "(1, 'FUNCTION'),  "
-                               "(2, 'PROCEDURE'), "
-                               "(3, 'AGGREGATE'), "
-                               "(4, 'FILTER FUNCTION'), "
-                               "(5, 'FUNCTION'),  "
-                               "(6, 'FUNCTION'),  "
-                               "(7, 'LOADER')) AS (id, function_type_keyword) "
-                       "WHERE id = function_type_id"
-                    "), "
-                    "function_languages AS ("
-                       "SELECT language_id, language_name, language_keyword "
-                       "FROM sys.function_languages, (VALUES "
-                               "(3, 'R'), "
-                               "(4, 'C'), "
-                               "(6, 'PYTHON'), "
-                               "(7, 'PYTHON_MAP'), "
-                               "(8, 'PYTHON2'), "
-                               "(9, 'PYTHON2_MAP'), "
-                               "(10, 'PYTHON3'), "
-                               "(11, 'PYTHON3_MAP'), "
-                               "(12, 'CPP')) AS (id, language_keyword) "
-                       "WHERE id = language_id"
-                    ")";
-
-       bool has_sys_comments = false;
-       MapiHdl hdl = mapi_query(mid, query);
-       if (hdl) {
-               if (mapi_error(mid)) {
-                       mapi_explain_result(hdl, stderr);
-               } else {
-                       if (mapi_fetch_row(hdl))
-                               has_sys_comments = true;
-               }
-               mapi_close_handle(hdl);
-       } else
-               mapi_explain(mid, stderr);
-
-       return has_sys_comments ? new_clause : old_clause;
-}
-
-const char *
-get_comments_clause(Mapi mid)
-{
-       static const char *comments_clause = NULL;
-       if (comments_clause == NULL) {
-               comments_clause = get_with_comments_as_clause(mid);
-               assert(comments_clause != NULL);
-       }
-       return comments_clause;
-}
-
 static int
 dquoted_print(stream *f, const char *s, const char *suff)
 {
@@ -364,54 +294,6 @@ bailout:
        return 0;
 }
 
-/* return TRUE if the sys.functions table has a column called system */
-static bool
-has_funcsys(Mapi mid)
-{
-       MapiHdl hdl;
-       bool ret;
-       static int answer = -1;
-
-       if (answer >= 0)
-               return answer;
-
-       if ((hdl = mapi_query(mid,
-                             "SELECT id "
-                             "FROM sys._columns "
-                             "WHERE name = 'system' "
-                             "AND table_id = ("
-                             " SELECT id"
-                             " FROM sys._tables"
-                             " WHERE name = 'functions'"
-                             " AND schema_id = ("
-                             "  SELECT id"
-                             "  FROM sys.schemas"
-                             "  WHERE name = 'sys'))")) == NULL ||
-           mapi_error(mid))
-               goto bailout;
-       ret = mapi_get_row_count(hdl) == 1;
-       while ((mapi_fetch_row(hdl)) != 0) {
-               if (mapi_error(mid))
-                       goto bailout;
-       }
-       if (mapi_error(mid))
-               goto bailout;
-       mapi_close_handle(hdl);
-       answer = ret;
-       return ret;
-
-bailout:
-       if (hdl) {
-               if (mapi_result_error(hdl))
-                       mapi_explain_result(hdl, stderr);
-               else
-                       mapi_explain_query(hdl, stderr);
-               mapi_close_handle(hdl);
-       } else
-               mapi_explain(mid, stderr);
-       return false;
-}
-
 static bool
 has_table_partitions(Mapi mid)
 {
@@ -1193,7 +1075,6 @@ describe_table(Mapi mid, const char *sch
        int type = 0;
        size_t maxquerylen;
        bool hashge;
-       const char *comments_clause = get_comments_clause(mid);
 
        if (schema == NULL) {
                if ((sname = strchr(tname, '.')) != NULL) {
@@ -1220,14 +1101,12 @@ describe_table(Mapi mid, const char *sch
                goto bailout;
 
        snprintf(query, maxquerylen,
-                "%s "
                 "SELECT t.name, t.query, t.type, t.id, c.remark "
                 "FROM sys.schemas s, sys._tables t "
                        "LEFT OUTER JOIN sys.comments c ON t.id = c.id "
                 "WHERE s.name = '%s' "
                   "AND t.schema_id = s.id "
                   "AND t.name = '%s'",
-                comments_clause,
                 s, t);
 
        if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
@@ -1446,13 +1325,11 @@ describe_table(Mapi mid, const char *sch
                if (cnt)
                        mnstr_printf(toConsole, ");\n");
                snprintf(query, maxquerylen,
-                       "%s "
                         "SELECT i.name, c.remark "
                         "FROM sys.idxs i, sys.comments c "
                         "WHERE i.id = c.id "
                           "AND i.table_id = (SELECT id FROM sys._tables WHERE 
schema_id = (select id FROM sys.schemas WHERE name = '%s') AND name = '%s') "
                         "ORDER BY i.name",
-                        comments_clause,
                         s, t);
                if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
                        goto bailout;
@@ -1466,13 +1343,11 @@ describe_table(Mapi mid, const char *sch
        }
 
        snprintf(query, maxquerylen,
-               "%s "
                 "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 col.number",
-                comments_clause,
                 s, t);
        if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
                goto bailout;
@@ -1534,7 +1409,6 @@ describe_sequence(Mapi mid, const char *
        char *query = NULL;
        size_t maxquerylen;
        char *sname = NULL;
-       const char *comments_clause = get_comments_clause(mid);
 
        if (schema == NULL) {
                if ((sname = strchr(tname, '.')) != NULL) {
@@ -1558,7 +1432,6 @@ describe_sequence(Mapi mid, const char *
                goto bailout;
 
        snprintf(query, maxquerylen,
-               "%s "
                "SELECT s.name, "                               /* 0 */
                       "seq.name, "                             /* 1 */
                       "get_value_for(s.name, seq.name), "      /* 2 */
@@ -1574,7 +1447,6 @@ describe_sequence(Mapi mid, const char *
                  "AND s.name = '%s' "
                  "AND seq.name = '%s' "
                "ORDER BY s.name, seq.name",
-               comments_clause,
                schema, tname);
 
        if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
@@ -1646,17 +1518,14 @@ describe_schema(Mapi mid, const char *sn
 {
        MapiHdl hdl = NULL;
        char schemas[5120];
-       const char *comments_clause = get_comments_clause(mid);
 
        snprintf(schemas, sizeof(schemas),
-               "%s "
                "SELECT s.name, a.name, c.remark "
                "FROM sys.auths a, "
                     "sys.schemas s LEFT OUTER JOIN sys.comments c ON s.id = 
c.id "
                "WHERE s.\"authorization\" = a.id "
                  "AND s.name = '%s' "
                "ORDER BY s.name",
-               comments_clause,
                sname);
 
        if ((hdl = mapi_query(mid, schemas)) == NULL || mapi_error(mid)) {
@@ -1916,14 +1785,12 @@ dump_function(Mapi mid, stream *toConsol
        char *ffunc = NULL, *flkey = NULL, *remark = NULL;
        char *sname, *fname, *ftkey;
        int flang, ftype;
-       const char *comments_clause = get_comments_clause(mid);
 
        query = malloc(query_size);
        if (query == NULL)
                goto bailout;
 
        query_len = snprintf(query, query_size,
-                     "%s "
                      "SELECT f.id, "
                             "f.func, "
                             "f.language, "
@@ -1939,7 +1806,7 @@ dump_function(Mapi mid, stream *toConsol
                           "LEFT OUTER JOIN sys.function_languages fl ON 
f.language = fl.language_id "
                           "LEFT OUTER JOIN sys.comments c ON f.id = c.id "
                      "WHERE f.id = %s",
-                     comments_clause, fid);
+                     fid);
        assert(query_len < (int) query_size);
        if (query_len < 0 || query_len >= (int) query_size ||
            (hdl = mapi_query(mid, query)) == NULL || mapi_error(mid)) {
@@ -2262,10 +2129,7 @@ dump_functions(Mapi mid, stream *toConso
                if (fname)
                        query_len += snprintf(query + query_len, query_size - 
query_len, "AND f.name = '%s' ", fname);
                if (!wantSystem) {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to