db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jayaram Subramanian <rsjay1...@gmail.com>
Subject Re: (DERBY-5010) [patch] bad equivalence check
Date Thu, 14 Apr 2011 03:20:15 GMT
Hi Knut,
Sorry for the delay.. It was hectic for me for the past 2 months..
When i placed thread.dumpstack and ran the lang.__suite, the log shows
a lot of references to isEquivalent method..  Just attaching one of
the example. Could you please guide me how to proceed from here

With Regards
Jayaram

java.lang.Throwable
	at java.lang.Thread.dumpStack(Thread.java:417)
	at org.apache.derby.impl.sql.compile.BaseColumnNode.isEquivalent(BaseColumnNode.java:180)
	at org.apache.derby.impl.sql.compile.SubstituteExpressionVisitor.visit(SubstituteExpressionVisitor.java:62)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:718)
	at org.apache.derby.impl.sql.compile.ResultColumn.acceptChildren(ResultColumn.java:1550)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.QueryTreeNodeVector.acceptChildren(QueryTreeNodeVector.java:141)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.ResultSetNode.acceptChildren(ResultSetNode.java:1611)
	at org.apache.derby.impl.sql.compile.FromBaseTable.acceptChildren(FromBaseTable.java:4621)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.SingleChildResultSetNode.acceptChildren(SingleChildResultSetNode.java:611)
	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.acceptChildren(ProjectRestrictNode.java:1843)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.SingleChildResultSetNode.acceptChildren(SingleChildResultSetNode.java:611)
	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.acceptChildren(ProjectRestrictNode.java:1843)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.SingleChildResultSetNode.acceptChildren(SingleChildResultSetNode.java:611)
	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.acceptChildren(ProjectRestrictNode.java:1843)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.SubqueryNode.acceptChildren(SubqueryNode.java:2300)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.UnaryOperatorNode.acceptChildren(UnaryOperatorNode.java:759)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.BinaryOperatorNode.acceptChildren(BinaryOperatorNode.java:855)
	at org.apache.derby.impl.sql.compile.QueryTreeNode.accept(QueryTreeNode.java:721)
	at org.apache.derby.impl.sql.compile.GroupByNode.addNewColumnsForAggregation(GroupByNode.java:566)
	at org.apache.derby.impl.sql.compile.GroupByNode.addAggregates(GroupByNode.java:245)
	at org.apache.derby.impl.sql.compile.GroupByNode.init(GroupByNode.java:184)
	at org.apache.derby.iapi.sql.compile.NodeFactory.getNode(NodeFactory.java:273)
	at org.apache.derby.impl.sql.compile.SelectNode.genProjectRestrict(SelectNode.java:1483)
	at org.apache.derby.impl.sql.compile.SelectNode.modifyAccessPaths(SelectNode.java:2123)
	at org.apache.derby.impl.sql.compile.SingleChildResultSetNode.modifyAccessPaths(SingleChildResultSetNode.java:439)
	at org.apache.derby.impl.sql.compile.SubqueryNode.modifyAccessPaths(SubqueryNode.java:1873)
	at org.apache.derby.impl.sql.compile.SubqueryList.modifyAccessPaths(SubqueryList.java:116)
	at org.apache.derby.impl.sql.compile.SelectNode.modifyAccessPaths(SelectNode.java:2051)
	at org.apache.derby.impl.sql.compile.SingleChildResultSetNode.modifyAccessPaths(SingleChildResultSetNode.java:439)
	at org.apache.derby.impl.sql.compile.SubqueryNode.modifyAccessPaths(SubqueryNode.java:1873)
	at org.apache.derby.impl.sql.compile.SubqueryList.modifyAccessPaths(SubqueryList.java:116)
	at org.apache.derby.impl.sql.compile.SelectNode.modifyAccessPaths(SelectNode.java:2051)
	at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(DMLStatementNode.java:317)
	at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(CursorNode.java:587)


On Tue, Feb 8, 2011 at 4:48 PM, Knut Anders Hatlen
<knut.hatlen@oracle.com> wrote:
>>> Knut Anders Hatlen commented on DERBY-5010:
>>> -------------------------------------------
>>>
>>> The current code looks wrong and the suggested fix looks right.
>>>
>>> None of our regression tests seem to exercise this code path,
>>> though. It would be good if someone could come up with a statement
>>> that caused this code to be executed so that we can verify that it
>>> behaves as expected after the proposed changes.
>
> Jayaram Subramanian <rsjay1976@gmail.com> writes:
>
>> Hi Knut,
>> I am interested in taking up this task.  Let me know your views on the same.
>
> Hi Jayaram,
>
> Thanks for volunteering to look into this. I think a good first step
> would be to find a query that actually ends up calling
> BaseColumnNode.isEquivalent(). I saw from some old test coverage reports
> that the method was called, but the parts of it that were touched by the
> patch were never executed. For example, you can add a call to
> Thread.dumpStack() in that method, run the lang test suite
> (org.apache.derbyTesting.functionTests.tests.lang._Suite), and see where
> it's called from.
>
> The method was added as part of DERBY-883, so I'd expect that queries
> that use it typically have aggregates and GROUP BY clauses.
>
> --
> Knut Anders
>

Mime
View raw message