[NO ISSUE][COMP] fix resolving PK field accesses & rewriting of meta() - user model changes: no - storage format changes: no - interface changes: no
details: This patch fixes resolving PK field accesses to the primary key variable (e.g. $ds.getField("id") is turned into $13 where id is a PK). The fix considers whether the PK is coming from the data record or the meta record. The patch also includes fixing rewriting of meta() references and replacing them with their corresponding meta variables. Now nested plans are visited also when looking for meta() references to take care of cases where the data scan producing the meta variable and the meta() references happen to be inside the nested plans. MetaFunctionToMetaVariable() is fired also after the rules which eliminate subplans to allow for rewriting of the meta() if it couldn't be replaced when the meta() reference was in the subplan but referring to meta variable outside the nested plan. ReinferAllTypesRule() is now fired before ByNameToByIndexFieldAccessRule() to allow the latter rule to get the up-to-date types in the whole plan.