Skip to content

Commit

Permalink
Fix usage of positional parameters in subqueries
Browse files Browse the repository at this point in the history
(too much aggressive usage of the execution plan cache)

Resolves: #8809
  • Loading branch information
luigidellaquila committed Mar 11, 2019
1 parent 4ae123d commit 3fbc935
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Object execute(OResult iCurrentRecord, OCommandContext ctx) {
return expression.execute(iCurrentRecord, ctx);
}
if (statement != null) {
OInternalExecutionPlan execPlan = statement.createExecutionPlan(ctx, false);
OInternalExecutionPlan execPlan = statement.createExecutionPlanNoCache(ctx, false);
if (execPlan instanceof OInsertExecutionPlan) {
((OInsertExecutionPlan) execPlan).executeInternal();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,27 @@ public void testUpsertNoIndex() {

}
}

@Test
public void testPositionalParams() {

String vClass1 = "testPositionalParamsV";
db.createVertexClass(vClass1);

String eClass = "testPositionalParamsE";
db.createEdgeClass(eClass);

for (int i = 0; i < 2; i++) {
OVertex v1 = db.newVertex(vClass1);
v1.setProperty("name", "v" + i);
v1.save();
}

db.command("CREATE EDGE " + eClass + " from (select from " + vClass1 + " WHERE name = ? ) to (select from " + vClass1
+ " WHERE name = ? )", "v0", "v1").close();

OResultSet result = db.query("select from " + eClass + " where out.name = 'v0' AND in.name = 'v1'");
Assert.assertTrue(result.hasNext());
result.close();
}
}

0 comments on commit 3fbc935

Please sign in to comment.