Clojure-Contrib

clojure.contrib.sql expects *err* to be a PrintWriter

Details

  • Type: Defect Defect
  • Status: In Progress In Progress
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

The problem is that c.c.sql.internal calls `.println` on a "stream" to print update counts and errors. That method only exists on a `PrintWriter`. This isn't true within Slime, where it's a `StringWriter`.

The attached patch binds `out` and uses `println` instead, which does the right thing. I've augmented the docstrings to request a `Writer` as the value of `stream`, which aligns with the docstring for `print`.

Activity

Hide
Sean Corfield added a comment -

This will be addressed in clojure.java.jdbc and needs to be migrated to the new JIRA project for it once that is created (I don't have permission to do anything beyond comment / clone this issue).

Show
Sean Corfield added a comment - This will be addressed in clojure.java.jdbc and needs to be migrated to the new JIRA project for it once that is created (I don't have permission to do anything beyond comment / clone this issue).
Hide
Assembla Importer added a comment -

scgilardi said: Following the discussion in the developer group and as suggested by Stuart Halloway, I'm planning to make these changes:

[1] adopt the substance of Richard Newman's patch, changes to sql.internal's print-sql-exception, print-sql-exception-chain, print-update-counts functions
[2] remove the automatic printing to err on exceptions. It will be up to the caller to handle the exceptions as he desires: eating, logging, or printing, etc.
[3] move the print* functions to c.c.sql proper as they will now be "public".

Show
Assembla Importer added a comment - scgilardi said: Following the discussion in the developer group and as suggested by Stuart Halloway, I'm planning to make these changes: [1] adopt the substance of Richard Newman's patch, changes to sql.internal's print-sql-exception, print-sql-exception-chain, print-update-counts functions [2] remove the automatic printing to err on exceptions. It will be up to the caller to handle the exceptions as he desires: eating, logging, or printing, etc. [3] move the print* functions to c.c.sql proper as they will now be "public".
Hide
Assembla Importer added a comment -

stuart.sierra said: Updating tickets (#1, #2, #3, #4, #6, #20, #23, #25, #30, #31, #33, #34, #35, #37, #38, #52, #55, #58, #59, #60, #61, #62, #63, #64)

Show
Assembla Importer added a comment - stuart.sierra said: Updating tickets (#1, #2, #3, #4, #6, #20, #23, #25, #30, #31, #33, #34, #35, #37, #38, #52, #55, #58, #59, #60, #61, #62, #63, #64)
Hide
Assembla Importer added a comment -

rnewman said: [file:btl6lW9Mmr3OPceJe5aVNr]: Diff against current head.

Show
Assembla Importer added a comment - rnewman said: [file:btl6lW9Mmr3OPceJe5aVNr]: Diff against current head.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: