Hi Dan,
 
I will take you up on your offer to "I'm willing to help out on any issues you discover on this new path." :)
 
While trying out the implementation you suggested (still not completely done), I noticed that when I try to sue +?/-? in function calls, the code flow is as follows
 at org.apache.derby.impl.sql.compile.SQLToJavaValueNode.getJSQLType(SQLToJavaValueNode.java:154)
 at org.apache.derby.impl.sql.compile.MethodCallNode.bindParameters(MethodCallNode.java:331)
 at org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpression (StaticMethodCallNode.java:170)
 at org.apache.derby.impl.sql.compile.JavaToSQLValueNode.bindExpression(JavaToSQLValueNode.java:250)
 at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(BinaryOperatorNode.java :309)
 at org.apache.derby.impl.sql.compile.BinaryComparisonOperatorNode.bindExpression(BinaryComparisonOperatorNode.java:137)
 at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:512)
 at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java:247)
 at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:161)
 at org.apache.derby.impl.sql.compile.ReadCursorNode.bind (ReadCursorNode.java:74)
 at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:250)
 at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:333)
 at org.apache.derby.impl.sql.GenericStatement.prepare (GenericStatement.java:107)
 at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
 at org.apache.derby.impl.jdbc.EmbedPreparedStatement .<init>(EmbedPreparedStatement.java:118)
 at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
 at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>( EmbedPreparedStatement30.java:62)
 at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java:92)
 at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:678)
 at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement (EmbedConnection.java:522)
 at org.apache.derbyTesting.functionTests.tests.lang.unaryArithmeticDynamicParameter.main(unaryArithmeticDynamicParameter.java:90)
 
SQLToJavaValueNode.getJSQLType after checking isParameterNode does ParameterNode casting so it can get to getJSQLType method. But since UnaryOperatorNode is not of the type ParameterNode, the casting fails, as expected. I can remove the casting but that would mean to implement getJSQLType method in ValueNode as well. But does this method make a sense for ValueNode? If we do decide to add this method, UnaryOperatorNode will simply call the same method on it's operand.
 
thanks,
Mamta

 
On 10/5/05, Daniel John Debrunner <djd@debrunners.com> wrote:
Daniel John Debrunner wrote:


> On this it seems that there is some current confusion in the code,
> ValueNode has two methods to set the type, setType and setDescriptor.
> So why does ParameterNode need a special set type method setDescriptor,
> and the associated required casting?

I got confused here, ParameterNode.setDescriptor is overriding
ValueNode.setDescriptor, so I'm not sure why the casting to
ParameterNode is required.

Still a move to a single method would be a good thing.

Dan.