db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r579781 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
Date Wed, 26 Sep 2007 20:00:55 GMT
Author: kmarsden
Date: Wed Sep 26 13:00:53 2007
New Revision: 579781

URL: http://svn.apache.org/viewvc?rev=579781&view=rev
Log:
DERBY-3081 cannot create instance of generated class because of java.lang.VerifyError in 4
tests on iseries
Change ansiTrim argument from 
- mb.upCast(leftInterfaceType);
to
+ mb.cast(leftInterfaceType);

to properly cast the argument to StringDataValue. Essentially what we were ending up with
in the generated code was this:

  public Object e2()
        throws StandardException, Exception
    {
        ConcatableDataValue concatabledatavalue = ((StringDataValue)getColumnFromRow(2, 2)).substring(getDataValueFactory().getDataValue(1,
null), getDataValueFactory().getDataValue(1, null), e3, 16);
        e3 = concatabledatavalue;
        StringDataValue stringdatavalue = ((StringDataValue)getColumnFromRow(2, 2)).ansiTrim(2,
concatabledatavalue, e2);
....

So we were passing a ConcatableDataValue instead of a StringDataValue to ansiTrim. Changing
from upCast to cast forces the cast so that ansiTrim gets called.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java?rev=579781&r1=579780&r2=579781&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
Wed Sep 26 13:00:53 2007
@@ -290,7 +290,7 @@
 		{
 			mb.push(trimType);
 			leftOperand.generateExpression(acb, mb);
-			mb.upCast(leftInterfaceType);
+			mb.cast(leftInterfaceType);
 
 			mb.getField(field);
 			nargs = 3;



Mime
View raw message