address WHERE NOT EXISTS on rebuilding query

parent ee22f306
......@@ -337,13 +337,12 @@ type whereRset struct {
}
func (r *whereRset) String() string {
s := ""
if r.sel != nil {
if r.exists {
s += " EXISTS "
s := ""
if !r.exists {
s += " NOT "
}
s += "(" + strings.TrimSuffix(r.sel.String(), ";") + ")"
return s
return fmt.Sprintf("%s EXISTS ( %s )", s, strings.TrimSuffix(r.sel.String(), ";"))
}
return r.expr.String()
}
......
......@@ -8404,7 +8404,7 @@ SELECT 42;
└Output field names [""]
---- 1348
SELECT * FROM t WHERE EXISTS (SELECT * FROM t WHERE i == 2);
SELECT * FROM t WHERE EXISTS ( SELECT * FROM t WHERE i == 2 );
┌Iterate all rows of table "t"
└Output field names ["i"]
┌Filter on i == 2
......@@ -8413,7 +8413,7 @@ SELECT * FROM t WHERE EXISTS (SELECT * FROM t WHERE i == 2);
└Output field names ["i"]
---- 1349
SELECT * FROM t WHERE EXISTS (SELECT * FROM t WHERE i == 2);
SELECT * FROM t WHERE EXISTS ( SELECT * FROM t WHERE i == 2 );
┌Iterate no rows
└Output field names ["i"]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment