jeffkreeftmeijer / navvy

Simple Ruby background job processor inspired by delayed_job, but aiming for database agnosticism.
https://jeffkreeftmeijer.com
Other
215 stars 23 forks source link

SQL syntax error #2

Closed anlek closed 14 years ago

anlek commented 14 years ago

Running Navvy::Worker.start After it runs my task, it calls count_all and raises this issue: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '== '4' OR parent_id == '4') AND failed_at IS NOT NULL)' at line 1: SELECT count(*) AS count_all FROM jobs WHERE ((id == '4' OR parent_id == '4') AND failed_at IS NOT NULL).

The problem is it should be id= '4' OR parent_id = '4' (and not double '==')

anlek commented 14 years ago

Issue was fixed in my fork: http://github.com/anlek/navvy/commit/ebcb1192bd5cad4925cea0a8aedbc62f55fc683d

anlek commented 14 years ago

My fixed seems to have caused a stack level too deep error

anlek commented 14 years ago

Never mind, my code had the stack level too deep, not the navvy code...

jeffkreeftmeijer commented 14 years ago

Hi Anlek,

Thanks a lot for creating the issue and fixing it. I pulled it in and pushed it to master. Also, the gem has been updated. Just re-install the gem and you'll be fine.

I have been testing Navvy on sqlite only -- and sqlite passes on this -- so I'll probably try to run its tests with MySQL sometime.

Thanks! :)

anlek commented 14 years ago

Glad I could help out (first project I got my code pulled ;) However, the gem doesn't seem to be updated.

jeffkreeftmeijer commented 14 years ago

It was a great fix. ;) The gem has been updated, sorry for that. :)