java.jdbc

delete-rows does not work with null WHERE

Details

  • Type: Defect Defect
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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
.

Activity

Hide
Sean Corfield added a comment -

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

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

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])
Show
Sean Corfield added a comment - 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])
Hide
Allen Rohner added a comment -

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

Show
Allen Rohner added a comment - I can't find the button to edit the issue, this happened on ver. 0.0.6

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: