<< Back to previous view

[JDBC-14] delete-rows does not work with null WHERE Created: 06/Aug/11  Updated: 04/Sep/11  Resolved: 04/Sep/11

Status: Resolved
Project: java.jdbc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Allen Rohner Assignee: Sean Corfield
Resolution: Declined Votes: 0
Labels: None


 Description   

(delete-rows "foo" [])
generates the SQL
delete from foo where null
, which deletes 0 rows. Instead, I expect it to generate
delete from foo
.



 Comments   
Comment by Allen Rohner [ 06/Aug/11 3:46 PM ]

I can't find the button to edit the issue, this happened on ver. 0.0.6

Comment by Sean Corfield [ 10/Aug/11 1:46 AM ]

I actually think that would be rather dangerous. Imagine constructing the where parameters dynamically and accidentally passing in an empty sequence - you'd delete everything in the table.

I believe you can safely and deliberately get the effect you are looking for by doing either of these:

(delete-rows "foo" [true])
(delete-rows "foo" [1])
Comment by Sean Corfield [ 04/Sep/11 1:32 AM ]

Given the lack of response to my comment and the fact that there is a clear and explicit workaround, I'm resolving this, declined.

Generated at Fri Oct 31 00:10:41 CDT 2014 using JIRA 4.4#649-r158309.