Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 77597 invoked from network); 4 Apr 2006 08:56:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Apr 2006 08:56:07 -0000 Received: (qmail 52830 invoked by uid 500); 4 Apr 2006 08:56:06 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 52800 invoked by uid 500); 4 Apr 2006 08:56:06 -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 52791 invoked by uid 99); 4 Apr 2006 08:56:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 01:56:05 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Apr 2006 01:56:05 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 32B2BD49FF for ; Tue, 4 Apr 2006 09:55:44 +0100 (BST) Message-ID: <1643137889.1144140944205.JavaMail.jira@ajax> Date: Tue, 4 Apr 2006 09:55:44 +0100 (BST) From: "Andreas Korneliussen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1177) updateObject with null as argument causes network driver to fail with NullPointerException In-Reply-To: <2037247827.1144074348771.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1177?page=comments#action_12373062 ] Andreas Korneliussen commented on DERBY-1177: --------------------------------------------- This bug has recently been introduced as part of DERBY-842. In CrossConverters.java Index: java/client/org/apache/derby/client/am/CrossConverters.java > @@ -802,9 +842,9 @@ } else if (source instanceof Byte) { return setObject(targetType, ((Byte) source).byteValue()); } else { - throw new SqlException(agent_.logWriter_, "Invalid data conversion:" + - " Parameter instance " + source + - " is invalid for requested conversion."); + throw new SqlException(agent_.logWriter_, + new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH), + source.getClass().getName(), Types.getTypeString(targetType)); The new code here causes nullpointerexception when source is NULL. In addition, when committing the patch for DERBY-842, the output file for updatableResultSet.out was changed to contain: - Got expected exception:Invalid data conversion: Parameter instance null is invalid for requested conversion. + Got expected exception:null Which obvisously is wrong. The bug was committed as rev. 390536. > updateObject with null as argument causes network driver to fail with NullPointerException > ------------------------------------------------------------------------------------------ > > Key: DERBY-1177 > URL: http://issues.apache.org/jira/browse/DERBY-1177 > Project: Derby > Type: Bug > Components: Network Client > Versions: 10.2.0.0 > Reporter: Andreas Korneliussen > Priority: Minor > Attachments: UpdateXXXTest.java > > Calling ResultSet.updateObject(column, object) causes the network driver to give NullPointerException if the object parameter is null. > Stack trace from test: > Test output: > ........E. > Time: 7.597 > There was 1 error: > 1) testUpdateObjectWithNull(org.apache.derbyTesting.functionTests.tests.jdbcapi.UpdateXXXTest)java.lang.NullPointerException > at org.apache.derby.client.am.CrossConverters.setObject(CrossConverters.java:845) > at org.apache.derby.client.am.ResultSet.updateObject(ResultSet.java:3073) > at org.apache.derbyTesting.functionTests.tests.jdbcapi.UpdateXXXTest.testUpdateObjectWithNull(UpdateXXXTest.java:215) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > Will attach the test. > To run: > java -Dframework=DerbyNetClient org.apache.derbyTesting.functionTests.harness.RunTest jdbcapi/UpdateXXXTest.junit > The test does not fail with the embedded framework. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira