<p dir="auto">Running the following query on an empty database</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH (n:L) WHERE n.p XOR (false XOR n.p OR null) RETURN n"><pre class="notranslate"><code class="notranslate">MATCH (n:L) WHERE n.p XOR (false XOR n.p OR null) RETURN n
</code></pre></div>
<p dir="auto">throws</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: org.neo4j.graphdb.QueryExecutionException: Expected 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None) 


Instead, got: 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)
Plan: ProduceResult(List(n)) {
  LHS -&gt; Selection(Ands(Vector(Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Null()))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Property(Variable(n),PropertyKeyName(p)), Property(Variable(n),PropertyKeyName(p)), Null())), Ors(List(Property(Variable(n),PropertyKeyName(p)), Not(False()), Not(Property(Variable(n),PropertyKeyName(p))), Null())), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False()), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False())))))) {
    LHS -&gt; Distinct(Map(n -&gt; Variable(n))) {
      LHS -&gt; Union() {
        LHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
        RHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
      }
    }
  }
} 


Differences:
 - QueryGraph
    A: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}
    B: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}

	at org.neo4j.kernel.impl.query.QueryExecutionKernelException.asUserException(QueryExecutionKernelException.java:35)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:293)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:274)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:268)
	... 4 more
Caused by: org.neo4j.kernel.impl.query.QueryExecutionKernelException: Expected 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None) 


Instead, got: 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)
Plan: ProduceResult(List(n)) {
  LHS -&gt; Selection(Ands(Vector(Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Null()))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Property(Variable(n),PropertyKeyName(p)), Property(Variable(n),PropertyKeyName(p)), Null())), Ors(List(Property(Variable(n),PropertyKeyName(p)), Not(False()), Not(Property(Variable(n),PropertyKeyName(p))), Null())), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False()), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False())))))) {
    LHS -&gt; Distinct(Map(n -&gt; Variable(n))) {
      LHS -&gt; Union() {
        LHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
        RHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
      }
    }
  }
} 


Differences:
 - QueryGraph
    A: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}
    B: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}

	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:131)
	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:115)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:285)
	... 8 more
Caused by: org.neo4j.exceptions.InternalException: Expected 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None) 


Instead, got: 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)
Plan: ProduceResult(List(n)) {
  LHS -&gt; Selection(Ands(Vector(Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Null()))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Property(Variable(n),PropertyKeyName(p)), Property(Variable(n),PropertyKeyName(p)), Null())), Ors(List(Property(Variable(n),PropertyKeyName(p)), Not(False()), Not(Property(Variable(n),PropertyKeyName(p))), Null())), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False()), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False())))))) {
    LHS -&gt; Distinct(Map(n -&gt; Variable(n))) {
      LHS -&gt; Union() {
        LHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
        RHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
      }
    }
  }
} 


Differences:
 - QueryGraph
    A: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}
    B: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}

	at org.neo4j.cypher.internal.compiler.planner.logical.steps.VerifyBestPlan$.apply(VerifyBestPlan.scala:70)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.plan(QueryPlanner.scala:121)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.process(QueryPlanner.scala:63)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.process(QueryPlanner.scala:51)
	at org.neo4j.cypher.internal.frontend.phases.Phase.$anonfun$transform$1(Phase.scala:36)
	at org.neo4j.cypher.internal.frontend.helpers.package$.$anonfun$closing$1(package.scala:24)
	at org.neo4j.cypher.internal.frontend.helpers.package$.using(package.scala:32)
	at org.neo4j.cypher.internal.frontend.helpers.package$.closing(package.scala:24)
	at org.neo4j.cypher.internal.frontend.phases.Phase.transform(Phase.scala:35)
	at org.neo4j.cypher.internal.frontend.phases.Phase.transform$(Phase.scala:33)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.transform(QueryPlanner.scala:51)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:79)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.If.transform(Transformer.scala:96)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:79)
	at org.neo4j.cypher.internal.compiler.CypherPlanner.planPreparedQuery(CypherPlanner.scala:70)
	at org.neo4j.cypher.internal.planning.CypherPlanner.doCreatePlan(CypherPlanner.scala:404)
	at org.neo4j.cypher.internal.planning.CypherPlanner.org$neo4j$cypher$internal$planning$CypherPlanner$$createPlan$1(CypherPlanner.scala:352)
	at org.neo4j.cypher.internal.planning.CypherPlanner$$anon$1.compile(CypherPlanner.scala:361)
	at org.neo4j.cypher.internal.planning.CypherPlanner$$anon$1.compile(CypherPlanner.scala:360)
	at org.neo4j.cypher.internal.QueryCache.$anonfun$compileAndCache$1(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.compileOrCompileWithExpressionCodeGenAndCache(QueryCache.scala:304)
	at org.neo4j.cypher.internal.QueryCache.compileAndCache(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.computeIfAbsentOrStale(QueryCache.scala:193)
	at org.neo4j.cypher.internal.planning.CypherPlanner.doPlan(CypherPlanner.scala:379)
	at org.neo4j.cypher.internal.planning.CypherPlanner.parseAndPlan(CypherPlanner.scala:269)
	at org.neo4j.cypher.internal.CypherCurrentCompiler.compile(CypherCurrentCompiler.scala:152)
	at org.neo4j.cypher.internal.MasterCompiler.compile(MasterCompiler.scala:86)
	at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$compilerWithExpressionCodeGenOption$2(ExecutionEngine.scala:229)
	at org.neo4j.cypher.internal.ExecutionEngine$$anon$2.compile(ExecutionEngine.scala:237)
	at org.neo4j.cypher.internal.ExecutionEngine$$anon$2.compile(ExecutionEngine.scala:231)
	at org.neo4j.cypher.internal.QueryCache.$anonfun$compileAndCache$1(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.compileOrCompileWithExpressionCodeGenAndCache(QueryCache.scala:304)
	at org.neo4j.cypher.internal.QueryCache.compileAndCache(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.computeIfAbsentOrStale(QueryCache.scala:193)
	at org.neo4j.cypher.internal.ExecutionEngine.getOrCompile(ExecutionEngine.scala:287)
	at org.neo4j.cypher.internal.ExecutionEngine.doExecute(ExecutionEngine.scala:200)
	at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$executeSubquery$1(ExecutionEngine.scala:178)
	at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:183)
	at org.neo4j.cypher.internal.ExecutionEngine.executeSubquery(ExecutionEngine.scala:175)
	at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:125)
	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:127)
	... 10 more"><pre class="notranslate"><code class="notranslate">Caused by: org.neo4j.graphdb.QueryExecutionException: Expected 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None) 


Instead, got: 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)
Plan: ProduceResult(List(n)) {
  LHS -&gt; Selection(Ands(Vector(Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Null()))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Property(Variable(n),PropertyKeyName(p)), Property(Variable(n),PropertyKeyName(p)), Null())), Ors(List(Property(Variable(n),PropertyKeyName(p)), Not(False()), Not(Property(Variable(n),PropertyKeyName(p))), Null())), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False()), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False())))))) {
    LHS -&gt; Distinct(Map(n -&gt; Variable(n))) {
      LHS -&gt; Union() {
        LHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
        RHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
      }
    }
  }
} 


Differences:
 - QueryGraph
    A: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}
    B: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}

	at org.neo4j.kernel.impl.query.QueryExecutionKernelException.asUserException(QueryExecutionKernelException.java:35)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:293)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:274)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:268)
	... 4 more
Caused by: org.neo4j.kernel.impl.query.QueryExecutionKernelException: Expected 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None) 


Instead, got: 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)
Plan: ProduceResult(List(n)) {
  LHS -&gt; Selection(Ands(Vector(Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Null()))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Property(Variable(n),PropertyKeyName(p)), Property(Variable(n),PropertyKeyName(p)), Null())), Ors(List(Property(Variable(n),PropertyKeyName(p)), Not(False()), Not(Property(Variable(n),PropertyKeyName(p))), Null())), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False()), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False())))))) {
    LHS -&gt; Distinct(Map(n -&gt; Variable(n))) {
      LHS -&gt; Union() {
        LHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
        RHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
      }
    }
  }
} 


Differences:
 - QueryGraph
    A: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}
    B: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}

	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:131)
	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:115)
	at org.neo4j.kernel.impl.coreapi.TransactionImpl.execute(TransactionImpl.java:285)
	... 8 more
Caused by: org.neo4j.exceptions.InternalException: Expected 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None) 


Instead, got: 
RegularSinglePlannerQuery(QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']},InterestingOrder(RequiredOrderCandidate(List()),List()),RegularQueryProjection(Map(n -&gt; Variable(n)),QueryPagination(None,None),Selections(Set())),None,None)
Plan: ProduceResult(List(n)) {
  LHS -&gt; Selection(Ands(Vector(Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Null()))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(Property(Variable(n),PropertyKeyName(p))), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Property(Variable(n),PropertyKeyName(p)), Property(Variable(n),PropertyKeyName(p)), Null())), Ors(List(Property(Variable(n),PropertyKeyName(p)), Not(False()), Not(Property(Variable(n),PropertyKeyName(p))), Null())), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False()), Property(Variable(n),PropertyKeyName(p)))), Ors(List(Not(Property(Variable(n),PropertyKeyName(p))), Not(False())))))) {
    LHS -&gt; Distinct(Map(n -&gt; Variable(n))) {
      LHS -&gt; Union() {
        LHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
        RHS -&gt; Selection(Ands(Vector(Not(Property(Variable(n),PropertyKeyName(p)))))) {
          LHS -&gt; NodeByLabelScan(n, LabelName(L), Set(), IndexOrderNone) {}
        }
      }
    }
  }
} 


Differences:
 - QueryGraph
    A: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}
    B: QueryGraph {Nodes: ['n'], Predicates: ['not n.p OR not NULL', 'n.p OR not false OR not n.p OR NULL', 'not n.p OR not false OR n.p', 'not n.p', 'n:L', 'n.p OR n.p OR NULL', 'not n.p OR not n.p', 'not n.p OR not false', 'not n.p OR not n.p OR n.p']}

	at org.neo4j.cypher.internal.compiler.planner.logical.steps.VerifyBestPlan$.apply(VerifyBestPlan.scala:70)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.plan(QueryPlanner.scala:121)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.process(QueryPlanner.scala:63)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.process(QueryPlanner.scala:51)
	at org.neo4j.cypher.internal.frontend.phases.Phase.$anonfun$transform$1(Phase.scala:36)
	at org.neo4j.cypher.internal.frontend.helpers.package$.$anonfun$closing$1(package.scala:24)
	at org.neo4j.cypher.internal.frontend.helpers.package$.using(package.scala:32)
	at org.neo4j.cypher.internal.frontend.helpers.package$.closing(package.scala:24)
	at org.neo4j.cypher.internal.frontend.phases.Phase.transform(Phase.scala:35)
	at org.neo4j.cypher.internal.frontend.phases.Phase.transform$(Phase.scala:33)
	at org.neo4j.cypher.internal.compiler.planner.logical.QueryPlanner$.transform(QueryPlanner.scala:51)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:79)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:78)
	at org.neo4j.cypher.internal.frontend.phases.If.transform(Transformer.scala:96)
	at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:79)
	at org.neo4j.cypher.internal.compiler.CypherPlanner.planPreparedQuery(CypherPlanner.scala:70)
	at org.neo4j.cypher.internal.planning.CypherPlanner.doCreatePlan(CypherPlanner.scala:404)
	at org.neo4j.cypher.internal.planning.CypherPlanner.org$neo4j$cypher$internal$planning$CypherPlanner$$createPlan$1(CypherPlanner.scala:352)
	at org.neo4j.cypher.internal.planning.CypherPlanner$$anon$1.compile(CypherPlanner.scala:361)
	at org.neo4j.cypher.internal.planning.CypherPlanner$$anon$1.compile(CypherPlanner.scala:360)
	at org.neo4j.cypher.internal.QueryCache.$anonfun$compileAndCache$1(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.compileOrCompileWithExpressionCodeGenAndCache(QueryCache.scala:304)
	at org.neo4j.cypher.internal.QueryCache.compileAndCache(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.computeIfAbsentOrStale(QueryCache.scala:193)
	at org.neo4j.cypher.internal.planning.CypherPlanner.doPlan(CypherPlanner.scala:379)
	at org.neo4j.cypher.internal.planning.CypherPlanner.parseAndPlan(CypherPlanner.scala:269)
	at org.neo4j.cypher.internal.CypherCurrentCompiler.compile(CypherCurrentCompiler.scala:152)
	at org.neo4j.cypher.internal.MasterCompiler.compile(MasterCompiler.scala:86)
	at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$compilerWithExpressionCodeGenOption$2(ExecutionEngine.scala:229)
	at org.neo4j.cypher.internal.ExecutionEngine$$anon$2.compile(ExecutionEngine.scala:237)
	at org.neo4j.cypher.internal.ExecutionEngine$$anon$2.compile(ExecutionEngine.scala:231)
	at org.neo4j.cypher.internal.QueryCache.$anonfun$compileAndCache$1(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.compileOrCompileWithExpressionCodeGenAndCache(QueryCache.scala:304)
	at org.neo4j.cypher.internal.QueryCache.compileAndCache(QueryCache.scala:276)
	at org.neo4j.cypher.internal.QueryCache.computeIfAbsentOrStale(QueryCache.scala:193)
	at org.neo4j.cypher.internal.ExecutionEngine.getOrCompile(ExecutionEngine.scala:287)
	at org.neo4j.cypher.internal.ExecutionEngine.doExecute(ExecutionEngine.scala:200)
	at org.neo4j.cypher.internal.ExecutionEngine.$anonfun$executeSubquery$1(ExecutionEngine.scala:178)
	at org.neo4j.cypher.internal.ExecutionEngine.closing(ExecutionEngine.scala:183)
	at org.neo4j.cypher.internal.ExecutionEngine.executeSubquery(ExecutionEngine.scala:175)
	at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:125)
	at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:127)
	... 10 more
</code></pre></div>
<p dir="auto">This might be a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1222979550" data-permission-text="Title is private" data-url="https://github.com/neo4j/neo4j/issues/12877" data-hovercard-type="issue" data-hovercard-url="/neo4j/neo4j/issues/12877/hovercard" href="https://github.com/neo4j/neo4j/issues/12877">#12877</a> but the query is slightly different so I reported it just in case.</p>
<p dir="auto"><strong>Neo4j Version:</strong> 4.4.6<br>
<strong>Operating System:</strong> 5.17.6 Arch Linux<br>
<strong>API:</strong> Java</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">I would expect the query not to throw any exception.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">An exception is thrown.</p>
<p dir="auto">Given an empty database, using asynchronous HTTP requests and the same exact MERGE command in rapid succession causes the neo4j server to create multiple instances of the same node. Tested on CentOS and Mac OS X using 2.1.5 release and local builds from master. Following is python code to trigger the issue:</p>
<p dir="auto">import requests # using requests instead of future requests "alleviates" the issue<br>
from requests_futures.sessions import FuturesSession<br>
from bson.json_util import dumps, loads</p>
<p dir="auto">def handleWedgeResponses(sess, r):<br>
print r.text</p>
<p dir="auto">session = FuturesSession()<br>
for i in range(2):<br>
statements = []<br>
statements.append({"statement": "MERGE (a:Author {name: 'abc'})"})<br>
r = session.post("<a href="http://localhost:7474/db/data/transaction/commit" rel="nofollow">http://localhost:7474/db/data/transaction/commit</a>", data=dumps({"statements": statements}), headers={'content-type': 'application/json'}, background_callback=handleWedgeResponses)</p>