Yes, the cloning was unnecessary. Removed. There was a caveat though. Since
the 'parameter' element belongs to the parent only, it must be propagated
to the children prior to parsing the children.


On Tue, Nov 12, 2013 at 11:12 PM, Paul A Martel <notifications@github.com>wrote:

> In src/frontend/org/voltdb/planner/AbstractParsedStmt.java:
>
> > @@ -999,6 +1020,22 @@ public String toString() {
> >          return retval;
> >      }
> >
> > +    private AbstractParsedStmt parseSubQuery(VoltXMLElement tableScan) {
> > +        AbstractParsedStmt subQuery = null;
> > +        for (VoltXMLElement childNode : tableScan.children) {
> > +            if (childNode.name.equalsIgnoreCase("
> tablesubquery")) {
> > +                if (!childNode.children.isEmpty()) {
> > +                    subQuery = AbstractParsedStmt.parse(sql, childNode.children.get(0), m_paramValues, m_db, joinOrder);
> > +                    // Propagate parameters from the parent to the child
> > +                    subQuery.m_paramsById.putAll(m_paramsById);
> > +                    subQuery.m_paramList = Arrays.copyOf(m_paramList, m_paramList.length);
>
> Is there some reason these common structures need to be cloned?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/alexeevm/voltdb/pull/6/files#r7616635>
> .
>