Closed vbedegi closed 9 years ago
Very strange, because:
(true? true)
;; => true
Just I have tested it in my repl. And the docstring is clear:
user=> (doc true?)
-------------------------
clojure.core/true?
([x])
Returns true if x is the value true, false otherwise.
Maybe is something related to mssql? This change fixes your problem?
I'm missing something or, mssql does not have boolean type: https://msdn.microsoft.com/en-us/library/ms378878(v=sql.110).aspx ??
Yes
(true? (java.lang.Boolean/TRUE)) => true
but
(true? (java.lang.Boolean. "true")) => false
I guess, their JDBC driver returns the latter. And yes, this change fixed my problem.
Using clojure.jdbc with MSSQL database, reading values from boolean columns seems to always return 'false'. The ResultSet contains the correct value ('true'), but applying true? to it always return false, since true? uses identical comparison.