File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ const (
256256 esIncRight
257257 esRightIterEOF
258258 esCompare
259+ esRejectNull
259260 esRet
260261)
261262
@@ -272,6 +273,7 @@ func (i *existsIter) Next(ctx *sql.Context) (sql.Row, error) {
272273 // when the secondaryProvider is empty
273274 // - antiJoin succeeds to RET when LOAD_RIGHT EOF's
274275 // - semiJoin fails when LOAD_RIGHT EOF's, falling back to LOAD_LEFT
276+ // - antiJoin fails when COMPARE returns true, falling back to LOAD_LEFT
275277 nextState := esIncLeft
276278 for {
277279 switch nextState {
@@ -323,6 +325,11 @@ func (i *existsIter) Next(ctx *sql.Context) (sql.Row, error) {
323325 return nil , err
324326 }
325327
328+ if res == nil && i .typ .IsExcludeNulls () {
329+ nextState = esRejectNull
330+ continue
331+ }
332+
326333 if ! sql .IsTrue (res ) {
327334 nextState = esIncRight
328335 } else {
@@ -337,6 +344,12 @@ func (i *existsIter) Next(ctx *sql.Context) (sql.Row, error) {
337344 nextState = esRet
338345 }
339346 }
347+ case esRejectNull :
348+ if i .typ .IsAnti () {
349+ nextState = esIncLeft
350+ } else {
351+ nextState = esIncRight
352+ }
340353 case esRet :
341354 return i .removeParentRow (left ), nil
342355 default :
You can’t perform that action at this time.
0 commit comments