db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mamta Satoor <msat...@gmail.com>
Subject Re: [jira] Commented: (DERBY-229) Column names on ResultSet.updateXXX and getXXX methods are handled incorrectly
Date Fri, 22 Apr 2005 17:46:25 GMT
I would like to echo Satheesh's comments on this bug. The fix for this
is very localized, probably touching only one java class in the engine
and probably even just one method in that java class. Will need to add
some simple tests and the bug will be all finished from what I can
analyze at this point.


On 4/19/05, Satheesh Bandaram <satheesh@sourcery.org> wrote:
> Looks like this bug has all the information needed to reproduce and to
> generate a patch. Is there any interest to submit a patch for this
> relatively easy fix? A complete patch would include a fix, along the general
> idea provided here and a test case added to jdbcapi test suite. Good
> opportunity for anyone wanting to get started modifying Derby code. Any
> volunteers? :-) 
> I am willing to help, if needed.
> Satheesh
> Mamta A. Satoor (JIRA) wrote:
>  [
> http://issues.apache.org/jira/browse/DERBY-229?page=comments#action_63128
> ]
Mamta A. Satoor commented on
> DERBY-229:

> getter [updater] methods with column names (in EmbedResultSet.java) use the
> protected method findColumnName(String columnName) to determine the column
> index for the passed column name. And the loop for the lookup starts from
> the end towards the beginning of the ResultDescription and that seems to be
> the problem behind the current behavior. 
 ResultDescription rd =
> resultDescription;

 // 1 or 0 based? assume 1 (probably wrong)
 for (int
> i=rd.getColumnCount(); i>=1; i--) {

 String name =
> rd.getColumnDescriptor(i).getName();
> (StringUtil.SQLEqualsIgnoreCase(columnName, name)) {
 return i;

> Column names on ResultSet.updateXXX and getXXX methods are handled
> incorrectly

> Key: DERBY-229
> http://issues.apache.org/jira/browse/DERBY-229
> Derby
 Type: Bug
 Components: JDBC
> Daniel John Debrunner
 Attachments: x.java

Sections 14.2.3 and [14.2.3] of
> JDBC 3.0 spec say
Column names supplied to getter [updater] methods are case
> insensitive. If a select list
contains the same column more than once, the
> first instance of the column will be
returned [updated].
Derby returns or
> updates the last column in the select list, not the first. With the attached
> Java class I see
> getXXX(name)

View raw message