Clojure

GC Issue 33: resultset-seq breaks when the result set contains duplicate column names (with patch)

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Reported by arohner, Jan 05, 2009
What (small set of) steps will reproduce the problem?

Create a java.sql.ResultSet containing two columns with the same name, and
then pass it to resultset-seq. 

What is the expected output? What do you see instead?
The expected output is an exception message that is helpful in diagnosing
the problem. resultset-seq instead throws "java.lang.RuntimeException:
java.lang.IllegalArgumentException: Too many arguments to struct constructor" 

What version are you using?
This was first reproduced in r1060. svn shows the function has not been
touched since 2008-07-29

Was this discussed on the group? If so, please provide a link to the
discussion:
http://groups.google.com/group/clojure/browse_frm/thread/e533e9cdf758f210?q=#43e5775c2d959dc7
http://groups.google.com/group/clojure/browse_thread/thread/58e4921de5c86c3c/7ca1de2daad839da?show_docid=7ca1de2daad839da

The attached patch modifies resultset-seq to throw an exception with the
message "
 resultset-seq.patch
1.5 KB Download
Comment 1 by arohner, Jan 05, 2009
The attached patch modifies resultset-seq to throw an exception with the message
"result set must have unique column names" when the column names are duplicated. It
also moves the definition of the set function above resultset-seq.
Comment 2 by richhickey, Feb 09, 2009
shouldn't this use distinct? instead of set+count
Comment 3 by arohner, Feb 09, 2009
You're right. I was not aware of distinct? Attaching v2 of the patch. This time,
rather than moving the definition of set up, I've moved the definition of
resultset-seq to below the definition of distinct?
 resultset-seq.v2.patch
2.2 KB Download
Comment 4 by richhickey, Apr 12, 2009
Fixed (also moved to using column labels) - r1346 - thanks for the report.
Status: Fixed

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: