Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 87351 invoked from network); 12 Mar 2008 23:52:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2008 23:52:24 -0000 Received: (qmail 17890 invoked by uid 500); 12 Mar 2008 23:52:21 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 17863 invoked by uid 500); 12 Mar 2008 23:52:21 -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 17854 invoked by uid 99); 12 Mar 2008 23:52:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2008 16:52:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2008 23:51:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A02BE234C092 for ; Wed, 12 Mar 2008 16:50:48 -0700 (PDT) Message-ID: <249655503.1205365848654.JavaMail.jira@brutus> Date: Wed, 12 Mar 2008 16:50:48 -0700 (PDT) From: "A B (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3341) TABLE FUNCTION returning CHAR values does not return a correct value if the Java ResultSet class returns a value less than the length of the defined CHAR. In-Reply-To: <4221390.1201045834725.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578083#action_12578083 ] A B commented on DERBY-3341: ---------------------------- I saw two failures when running suites.All with weme6.1 last night, both in TableTestFunction with similar diffs. Ex: noSpecialCollation(o.a.dTesting.functionTests.tests.lang.TableFunctionTest)java.sql.SQLException: An attempt was made to get a data value of type 'java.lang.Object' from a data value of type 'DECIMAL'. at o.a.d.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at o.a.d.impl.jdbc.Util.generateCsSQLException(Unknown Source) at o.a.d.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at o.a.d.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at o.a.d.impl.jdbc.EmbedConnection.handleException(Unknown Source) at o.a.d.impl.jdbc.ConnectionChild.handleException(Unknown Source) at o.a.d.impl.jdbc.EmbedResultSet.closeOnTransactionError(Unknown Source) at o.a.d.impl.jdbc.EmbedResultSet.movePosition(Unknown Source) at o.a.d.impl.jdbc.EmbedResultSet.next(Unknown Source) at o.a.dTesting.functionTests.tests.lang.TableFunctionTest.assertResults(TableFunctionTest.java:1935) at o.a.dTesting.functionTests.tests.lang.TableFunctionTest.assertResults(TableFunctionTest.java:1776) at o.a.dTesting.functionTests.tests.lang.TableFunctionTest.assertResults(TableFunctionTest.java:1762) at o.a.dTesting.functionTests.tests.lang.TableFunctionTest.allLegalDatatypesVTIResults(TableFunctionTest.java:1178) at o.a.dTesting.functionTests.tests.lang.TableFunctionTest.tableFunctionTest(TableFunctionTest.java:921) at o.a.dTesting.functionTests.tests.lang.TableFunctionTest.noSpecialCollation(TableFunctionTest.java:897) at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205) at o.a.dTesting.junit.BaseTestCase.runBare(BaseTestCase.java:101) Caused by: ERROR 22005: An attempt was made to get a data value of type 'java.lang.Object' from a data value of type 'DECIMAL'. at o.a.d.iapi.error.StandardException.newException(Unknown Source) at o.a.d.iapi.types.DataType.dataTypeConversion(Unknown Source) at o.a.d.iapi.types.DataType.getObject(Unknown Source) at o.a.d.impl.sql.execute.VTIResultSet.cast(Unknown Source) at o.a.d.impl.sql.execute.VTIResultSet.populateFromResultSet(Unknown Source) at o.a.d.impl.sql.execute.VTIResultSet.getNextRowCore(Unknown Source) at o.a.d.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(Unknown Source) The other failure was the "specialCollation()" fixture. I'm guessing you're not running tests with weme6.1, but any chance you might be able identify the cause? Or should I file a separate issue? > TABLE FUNCTION returning CHAR values does not return a correct value if the Java ResultSet class returns a value less than the length of the defined CHAR. > ---------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-3341 > URL: https://issues.apache.org/jira/browse/DERBY-3341 > Project: Derby > Issue Type: Bug > Components: SQL > Reporter: Daniel John Debrunner > Fix For: 10.4.0.0 > > Attachments: derby-3341-01-coerce.diff, derby-3341-01-da-coerceWithTests.diff, derby-3341-02-aa-refGuide.diff, derby_3341_test.txt, rrefcreatefunctionstatement.html > > > Defining a column in the returned type as CHAR(10) requires that the returned value be of length 10 characters. > Defining a table function with a return type of: > returns TABLE column0 char( 10 ), column1 char( 10 )) > seems to just return whatever the Java ResultSet implementation handed it. > My guess this is true for all variable length types, no casting of the value occurs when it is returned to the SQL domain. > Java single value functions and procedure out parameters do perform any required casting to ensure the value is of the declared type. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.