if (c != null) {
pid = c.getProcedureID();
}
String fullName = metadata.getFullName(pid);
fullName = "procedure cache:" + fullName; //$NON-NLS-1$
PreparedPlan pp = context.getPlan(fullName);
if (pp == null) {
Determinism determinismLevel = context.resetDeterminismLevel();
CommandContext clone = context.clone();
ProcessorPlan plan = planProcedure(command, metadata, idGenerator, capFinder, analysisRecord, clone);
//note that this is not a full prepared plan. It is not usable by user queries.
if (pid instanceof Procedure) {
clone.accessedPlanningObject(pid);
}
pp = new PreparedPlan();
pp.setPlan(plan, clone);
context.putPlan(fullName, pp, context.getDeterminismLevel());
context.setDeterminismLevel(determinismLevel);
}
result = pp.getPlan().clone();
for (Object id : pp.getAccessInfo().getObjectsAccessed()) {
context.accessedPlanningObject(id);
}
}
// propagate procedure parameters to the plan to allow runtime type checking
ProcedureContainer container = (ProcedureContainer)cupc.getUserCommand();