java.jdbc

Some JDBC drivers return a Boolean that is constructed and not identical to Clojure's true/false

Details

  • Type: Defect Defect
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

After some experimentation, I've discovered that certain JDBC drivers return the equivalent of (Boolean. true) and (Boolean. false) which are truthy/falsey but sometimes produce surprising results since they are not actually true and false. Extending the result set reading protocol to Boolean to turn them into canonical values via if seems to do the trick.

Activity

Hide
Sean Corfield added a comment -

Added Boolean implementation to IResultSetReadColumn.

Show
Sean Corfield added a comment - Added Boolean implementation to IResultSetReadColumn.
Hide
Sean Corfield added a comment -

A simple (if v true false) is not sufficient for this - it needs to be (if (= true v) true false) based on tests I've conducted. The problem is that the constructed (Boolean. false) value behaves as truthy.

Show
Sean Corfield added a comment - A simple (if v true false) is not sufficient for this - it needs to be (if (= true v) true false) based on tests I've conducted. The problem is that the constructed (Boolean. false) value behaves as truthy.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: