Changeset: 80f0854326ea for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/80f0854326ea
Modified Files:
        clients/mapiclient/mhelp.c
        sql/backends/monet5/rel_bin.c
        sql/server/rel_unnest.c
        sql/test/BugTracker-2025/Tests/All
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Mar2025 branch.


diffs (191 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -103,10 +103,11 @@ SQLhelp sqlhelp1[] = {
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-programming/flow-of-control/"},
        {"COMMENT",
         "Add, update or remove a comment or description for a database object",
-        "COMMENT ON { SCHEMA | TABLE | VIEW | INDEX | SEQUENCE | function_type 
}\n"
-        "     qname IS { 'my description text' | NULL | '' }\n"
-        "COMMENT ON COLUMN q3name IS { 'my description text' | NULL | '' }",
-        "function_type,qname,q3name",
+        "COMMENT ON SCHEMA ident IS { 'comment text' | NULL | '' }\n"
+        "COMMENT ON { TABLE | VIEW | INDEX | SEQUENCE } qname IS { 'comment 
text' | NULL | '' }\n"
+        "COMMENT ON COLUMN q3name IS { 'comment text' | NULL | '' }\n"
+        "COMMENT ON function_type qname [ '(' [ data_type [',' ...]] ')' ] IS 
{ 'comment text' | NULL | '' }",
+        "function_type,qname,q3name,ident",
         NULL},
        {"COMMIT",
         "Commit the current transaction",
@@ -146,7 +147,7 @@ SQLhelp sqlhelp1[] = {
         "can also be defined in other programming languages such as Python, R, 
C or CPP.",
         "CREATE [ OR REPLACE ] AGGREGATE [ FUNCTION ] qname '(' { '*' | [ 
param [',' ...]] } ')'\n"
         "    RETURNS function_return_data_type\n"
-        "    EXTERNAL NAME ident ',' ident\n"
+        "    EXTERNAL NAME ident '.' ident\n"
         "CREATE [ OR REPLACE ] AGGREGATE [ FUNCTION ] qname '(' { '*' | [ 
param [',' ...]] } ')'\n"
         "    RETURNS function_return_data_type\n"
         "    LANGUAGE language_keyword external_code",
@@ -156,7 +157,7 @@ SQLhelp sqlhelp1[] = {
         "Create a user-defined filter function. Currently only MAL 
definitions\n"
         "CREATE [ OR REPLACE ] FILTER [ FUNCTION ] qname '(' { '*' | [ param 
[',' ...]] } ')'\n"
         "    RETURNS function_return_data_type\n"
-        "    EXTERNAL NAME ident ',' ident",
+        "    EXTERNAL NAME ident '.' ident",
         "qname,param,function_return_data_type,ident",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-programming/function-definitions/"},
        {"CREATE FUNCTION",
@@ -167,7 +168,7 @@ SQLhelp sqlhelp1[] = {
         "    BEGIN [ ATOMIC ] statement [ ';' ...] END\n"
         "CREATE [ OR REPLACE ] FUNCTION qname '(' { '*' | [ param [',' ...]] } 
')'\n"
         "    RETURNS function_return_data_type\n"
-        "    EXTERNAL NAME ident ',' ident\n"
+        "    EXTERNAL NAME ident '.' ident\n"
         "CREATE [ OR REPLACE ] FUNCTION qname '(' { '*' | [ param [',' ...]] } 
')'\n"
         "    RETURNS function_return_data_type\n"
         "    LANGUAGE language_keyword external_code",
@@ -194,7 +195,7 @@ SQLhelp sqlhelp1[] = {
         "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] 
} ')'\n"
         "    BEGIN [ ATOMIC ] procedure_statement [ ';' ...] END\n"
         "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] 
} ')'\n"
-        "    EXTERNAL NAME ident ',' ident",
+        "    EXTERNAL NAME ident '.' ident",
         "qname,param,procedure_statement,ident",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-programming/procedure-definitions/"},
        {"CREATE REMOTE TABLE",
@@ -266,11 +267,10 @@ SQLhelp sqlhelp1[] = {
         "qname,column_list,query_expression",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-manual/data-definition/view-definition/"},
        {"CREATE WINDOW",
-        "Create a user-defined window function. Currently only MAL 
definitions\n"
-        "are supported.",
+        "Create a user-defined window function. Currently only MAL definitions 
are supported.",
         "CREATE [ OR REPLACE ] WINDOW [ FUNCTION ] qname '(' { '*' | [ param 
[',' ...]] } ')'\n"
         "    RETURNS function_return_data_type\n"
-        "    EXTERNAL NAME ident ',' ident",
+        "    EXTERNAL NAME ident '.' ident",
         "qname,param,function_return_data_type,ident",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-manual/data-manipulation/window-expressions/"},
        {"CURRENT_DATE",
@@ -818,7 +818,7 @@ SQLhelp sqlhelp2[] = {
         NULL},
        {"privileges",
         NULL,
-        "table_privileges | EXECUTE ON function_type qname | 
global_privileges",
+        "table_privileges | EXECUTE ON function_type qname [ '(' [ data_type 
[',' ...]] ')' ] | global_privileges",
         "function_type,table_privileges,global_privileges",
         NULL},
        {"procedure_statement",
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -3513,7 +3513,13 @@ rel2bin_antijoin(backend *be, sql_rel *r
        list *l, *jexps = NULL, *sexps = NULL;
        node *en = NULL, *n;
        stmt *left = NULL, *right = NULL, *join = NULL, *sel = NULL, *sub = 
NULL;
-
+       bool any = false;
+
+       if (rel->exps)
+               for (node *n = rel->exps->h; n && !any; n = n->next) {
+                       sql_exp *e = n->data;
+                       any = is_any(e);
+               }
        if (rel->l) /* first construct the left sub relation */
                left = subrel_bin(be, rel->l, refs);
        if (rel->r) /* first construct the right sub relation */
@@ -3586,7 +3592,7 @@ rel2bin_antijoin(backend *be, sql_rel *r
                stmt *jr = stmt_result(be, join, 1);
                stmt *nulls = NULL;
 
-               if (li && stmt_has_null(li)) {
+               if (li && stmt_has_null(li) && any) {
                        nulls = stmt_selectnil(be, li);
                }
                /* construct relation */
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -3364,6 +3364,7 @@ rewrite_anyequal(visitor *v, sql_rel *re
                                }
                                if (!rewrite)
                                        return NULL;
+                               sql_exp *inexp;
                                if (is_tuple) {
                                        list *t = le->f;
                                        int s1 = list_length(t), s2 = 
list_length(rsq->exps);
@@ -3373,8 +3374,11 @@ rewrite_anyequal(visitor *v, sql_rel *re
                                                return sql_error(sql, 02, 
SQLSTATE(42000) "Subquery has too %s columns", (s2 < s1) ? "few" : "many");
                                        if (!rewrite->exps)
                                                rewrite->exps = 
sa_list(sql->sa);
-                                       for (node *n = t->h, *m = rsq->exps->h; 
n && m; n = n->next, m = m->next )
-                                               append(rewrite->exps, 
exp_compare(sql->sa, n->data, exp_ref(sql, m->data), cmp_equal));
+                                       for (node *n = t->h, *m = rsq->exps->h; 
n && m; n = n->next, m = m->next ) {
+                                               append(rewrite->exps, inexp = 
exp_compare(sql->sa, n->data, exp_ref(sql, m->data), cmp_equal));
+                                               if (inexp)
+                                                       set_any(inexp);
+                                       }
                                        v->changes++;
                                        return exp_atom_bool(sql->sa, 1);
                                } else {
@@ -3384,7 +3388,9 @@ rewrite_anyequal(visitor *v, sql_rel *re
                                                return NULL;
                                        if (!rewrite->exps)
                                                rewrite->exps = 
sa_list(sql->sa);
-                                       append(rewrite->exps, 
exp_compare(sql->sa, le, exp_ref(sql, re), cmp_equal));
+                                       append(rewrite->exps, 
inexp=exp_compare(sql->sa, le, exp_ref(sql, re), cmp_equal));
+                                       if (inexp)
+                                               set_any(inexp);
                                        v->changes++;
                                        return exp_atom_bool(sql->sa, 1);
                                }
diff --git a/sql/test/BugTracker-2025/Tests/7688_not_exists_null.test 
b/sql/test/BugTracker-2025/Tests/7688_not_exists_null.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2025/Tests/7688_not_exists_null.test
@@ -0,0 +1,12 @@
+
+statement ok
+create table a (i int, j int)
+
+statement ok
+insert into a values(0, 1), (2, 4)
+
+query II
+select * from (select cast(null as int), 0 ) b(i,j) where not exists (select 1 
from a where a.i = b.i and a.j = b.j)
+----
+NULL
+0
diff --git a/sql/test/BugTracker-2025/Tests/All 
b/sql/test/BugTracker-2025/Tests/All
--- a/sql/test/BugTracker-2025/Tests/All
+++ b/sql/test/BugTracker-2025/Tests/All
@@ -29,3 +29,4 @@ 7674-rel_find_designated_index_crash
 7680-union-all
 7682_trigger_crash
 7686-delete-all-empty-table
+7688_not_exists_null
diff --git a/sql/test/bugs/Tests/rtrim_bug.test 
b/sql/test/bugs/Tests/rtrim_bug.test
--- a/sql/test/bugs/Tests/rtrim_bug.test
+++ b/sql/test/bugs/Tests/rtrim_bug.test
@@ -55,7 +55,7 @@ project (
 | | project (
 | | | table("sys"."t1") [ "t1"."m" NOT NULL UNIQUE ]
 | | ) [ "sys"."rtrim"("t1"."m" NOT NULL UNIQUE) NOT NULL as "%1"."%1" ]
-| ) [ ("%4"."%4" NOT NULL) = ("%1"."%1" NOT NULL) ]
+| ) [ ("%4"."%4" NOT NULL) + = ("%1"."%1" NOT NULL) ]
 ) [ "sys"."length"("t1"."m" NOT NULL UNIQUE) NOT NULL as "data_length", 
"t1"."m" NOT NULL UNIQUE as "data_value" ]
 
 statement ok
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1866,6 +1866,9 @@ def RunTest(env, TST, COND, oktests, len
                 print('%s%s' % (prompt(), s), end='')
                 prred('TEST MISSING')
                 print()
+            else:
+                prred('MISSING')
+                print(':', os.path.join(TSTDIR, TSTSUFF, TST + EXT))
 
             return TX,Failed,Failed,elem,reason,links
 
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to