Changeset: b100823be403 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b100823be403
Modified Files:
        sql/server/rel_unnest.c
        sql/test/SQLancer/Tests/sqlancer06.stable.err
Branch: Oct2020
Log Message:

fix another sqlancer bug. No need for special handling of single values with
group by's, as we do this already using the 'single' join handling.


diffs (56 lines):

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
@@ -2279,22 +2279,6 @@ rewrite_anyequal(mvc *sql, sql_rel *rel,
        return e;
 }
 
-static const char *
-compare_aggr_op( char *compare, int quantifier)
-{
-       if (quantifier == 0)
-               return "zero_or_one";
-       switch(compare[0]) {
-       case '<':
-               if (compare[1] == '>')
-                       return "all";
-               return "min";
-       case '>':
-               return "max";
-       default:
-               return "all";
-       }
-}
 /* exp visitor */
 /* rewrite compare expressions including quantifiers any and all */
 static sql_exp *
@@ -2412,14 +2396,6 @@ rewrite_compare(visitor *v, sql_rel *rel
                                        re = exp_aggr1(v->sql->sa, re, a, 0, 1, 
CARD_AGGR, has_nil(re));
                                        re = rel_groupby_add_aggr(v->sql, rsq, 
re);
                                        set_processed(rsq);
-                               } else if (rsq && exp_card(re) > CARD_ATOM) {
-                                       sql_subfunc *zero_or_one = 
sql_bind_func(v->sql->sa, NULL, compare_aggr_op(op, quantifier), 
exp_subtype(re), NULL, F_AGGR);
-
-                                       rsq = rel_groupby(v->sql, rsq, NULL);
-
-                                       re = exp_aggr1(v->sql->sa, re, 
zero_or_one, 0, 0, CARD_AGGR, has_nil(re));
-                                       re = rel_groupby_add_aggr(v->sql, rsq, 
re);
-                                       set_processed(rsq);
                                }
                                if (rsq)
                                        (void)rewrite_inner(v->sql, rel, rsq, 
is_cnt?op_left:op_join);
diff --git a/sql/test/SQLancer/Tests/sqlancer06.stable.err 
b/sql/test/SQLancer/Tests/sqlancer06.stable.err
--- a/sql/test/SQLancer/Tests/sqlancer06.stable.err
+++ b/sql/test/SQLancer/Tests/sqlancer06.stable.err
@@ -19,9 +19,8 @@ ERROR = !INSERT INTO: UNIQUE constraint 
 CODE  = 40002
 MAPI  = (monetdb) /var/tmp/mtest-331577/.s.monetdb.32973
 QUERY = SELECT CAST(((t0.c0)<(COALESCE((SELECT DISTINCT t0.c0 FROM t0, t2, 
t1), t0.c0, t2.c0))) AS INT) FROM t2 RIGHT OUTER JOIN t0 ON t2.c0 = ANY(SELECT 
t1.c0 FROM t1, t2);
-ERROR = !zero_or_one: cardinality violation, scalar expression expected
-CODE  = M0M29
-MAPI  = (monetdb) /var/tmp/mtest-174425/.s.monetdb.32391
+ERROR = !GDK reported error: BATsubcross: more than one match
+MAPI  = (monetdb) /var/tmp/mtest-2100068/.s.monetdb.34872
 QUERY = SELECT t1.c2 FROM t2 RIGHT OUTER JOIN t1 ON (t2.c1) WHERE (SELECT 
t1.c2 FROM t1) = ALL(SELECT t0.c2 FROM t0, t2);
 ERROR = !GDK reported error: BATsubcross: more than one match
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to