Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 28931 invoked from network); 19 Jun 2007 21:38:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jun 2007 21:38:50 -0000 Received: (qmail 46383 invoked by uid 500); 19 Jun 2007 21:38:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 46320 invoked by uid 500); 19 Jun 2007 21:38:51 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 46302 invoked by uid 99); 19 Jun 2007 21:38:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2007 14:38:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2007 14:38:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 42822714191 for ; Tue, 19 Jun 2007 14:38:26 -0700 (PDT) Message-ID: <20541337.1182289106269.JavaMail.jira@brutus> Date: Tue, 19 Jun 2007 14:38:26 -0700 (PDT) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-2848) Missing method referenced in generated code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Missing method referenced in generated code ------------------------------------------- Key: DERBY-2848 URL: https://issues.apache.org/jira/browse/DERBY-2848 Project: Derby Issue Type: Bug Components: SQL Affects Versions: 10.3.0.0 Reporter: Rick Hillegas The following script raises an error during byte code generation: ij version 10.3 ij> --connect 'jdbc:derby://localhost:8246/auth10.3;create=true;user="rick";password=rickspassword'; connect 'jdbc:derby:db10.3;create=true'; WARNING 01J01: Database 'db10.3' not created, connection made to existing database instead. ij> drop function makeBlob; 0 rows inserted/updated/deleted ij> drop table lobtable; 0 rows inserted/updated/deleted ij> create table lobtable ( keyCol int generated always as identity, clob1 clob, descCol varchar( 50 ), clob2 clob, blob1 blob, updateCount int, blob2 blob ); 0 rows inserted/updated/deleted ij> create function makeBlob ( byteString varchar( 50 ) ) returns blob language java parameter style java no sql external name 'other.MyBlob.makeBlob' ; 0 rows inserted/updated/deleted ij> insert into lobtable ( clob1, descCol, clob2, blob1, updateCount, blob2 ) values ( 'Who put the bop ', 'Doo wop', 'in the bopshebop ', makeBlob( 'Had we but world enough and time ' ), 1, makeBlob( 'this coyness, mistress, would be no crime ' ) ); java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueFactory.getBlobDataValue(java.sql.Blob, org.apache.derby.iapi.types.BitDataValue) at java.lang.Class.getDeclaredMethod(Class.java:1264) at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132) at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745) at org.apache.derby.impl.sql.compile.BaseTypeCompiler.generateDataValue(BaseTypeCompiler.java:194) at org.apache.derby.impl.sql.compile.ExpressionClassBuilder.generateDataValue(ExpressionClassBuilder.java:899) at org.apache.derby.impl.sql.compile.JavaToSQLValueNode.generateExpression(JavaToSQLValueNode.java:169) at org.apache.derby.impl.sql.compile.CastNode.generateExpression(CastNode.java:855) at org.apache.derby.impl.sql.compile.SQLToJavaValueNode.generateSQLValue(SQLToJavaValueNode.java:352) at org.apache.derby.impl.sql.compile.SQLToJavaValueNode.generateExpression(SQLToJavaValueNode.java:332) at org.apache.derby.impl.sql.compile.JavaToSQLValueNode.generateExpression(JavaToSQLValueNode.java:166) at org.apache.derby.impl.sql.compile.ResultColumn.generateExpression(ResultColumn.java:891) at org.apache.derby.impl.sql.compile.ResultColumnList.generateCore(ResultColumnList.java:1176) at org.apache.derby.impl.sql.compile.ResultColumnList.generate(ResultColumnList.java:1015) at org.apache.derby.impl.sql.compile.RowResultSetNode.generate(RowResultSetNode.java:690) at org.apache.derby.impl.sql.compile.NormalizeResultSetNode.generate(NormalizeResultSetNode.java:122) at org.apache.derby.impl.sql.compile.InsertNode.generate(InsertNode.java:837) at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347) at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:447) at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:748) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:579) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:528) at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:330) at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:522) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:364) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:262) at org.apache.derby.impl.tools.ij.Main.go(Main.java:215) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:181) at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56) at org.apache.derby.tools.ij.main(ij.java:71) Invalid method org.apache.derby.iapi.types.DataValueFactory >> org.apache.derby.iapi.types.BitDataValue getBlobDataValue(java.sql.Blob, org.apache.derby.iapi.types.BitDataValue) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueFactory.getBlobDataValue(java.sql.Blob, org.apache.derby.iapi.types.BitDataValue) ERROR XJ001: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueFactory >> org.apache.derby.iapi.types.BitDataValue getBlobDataValue(java.sql.Blob, org.apache.derby.iapi.types.BitDataValue) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueFactory.getBlobDataValue(java.sql.Blob, org.apache.derby.iapi.types.BitDataValue): org.apache.derby.shared.common.sanity.AssertFailure'. The script is attempting to stuff a user-generated blob into a blob column. Here is the user function which creates the blob: package other; import java.io.*; import java.sql.*; /** *

* A crude Blob implementation for datatype testing. *

*/ public class MyBlob implements Blob { private byte[] _bytes; public static Blob makeBlob( String byteString ) { return new MyBlob( byteString ); } public MyBlob( String byteString ) { _bytes = byteString.getBytes(); } public MyBlob( byte[] bytes ) { _bytes = bytes; } public InputStream getBinaryStream() { return new ByteArrayInputStream( _bytes ); } public byte[] getBytes( long position, int length ) { return _bytes; } public long length() { return (long) _bytes.length; } public long position( Blob pattern, long start ) { return 0L; } public long position( byte[] pattern, long start ) { return 0L; } public boolean equals( Object other ) { if ( other == null ) { return false; } if ( !( other instanceof Blob ) ) { return false; } Blob that = (Blob) other; try { if ( this.length() != that.length() ) { return false; } InputStream thisStream = this.getBinaryStream(); InputStream thatStream = that.getBinaryStream(); while( true ) { int nextByte = thisStream.read(); if ( nextByte < 0 ) { break; } if ( nextByte != thatStream.read() ) { return false; } } } catch (Exception e) { System.err.println( e.getMessage() ); e.printStackTrace(); return false; } return true; } public int setBytes(long arg0, byte[] arg1) throws SQLException { throw new SQLException("not implemented for this test"); } public int setBytes(long arg0, byte[] arg1, int arg2, int arg3) throws SQLException { throw new SQLException("not implemented for this test"); } public OutputStream setBinaryStream(long arg0) throws SQLException { throw new SQLException("not implemented for this test"); } public void truncate(long arg0) throws SQLException { throw new SQLException("not implemented for this test"); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.