Comments (10)
π I am also getting this on MySQL 5.0.x and MySQL 5.1.x
After some brief investigation, it appears as though that there are a couple of MySQL support issues.
The first of which comes from using LIMIT inside of a subquery that gets constructed here.
The second issue is attempting to update a table of the same name it uses in a subquery here.
Both of which MySQL versions 5.1.x and 5.0.x do not support.
http://dev.mysql.com/doc/refman/5.0/en/subquery-restrictions.html
It would be nice if a core-contributor could chime in as to the purpose of these uses of limiting and updating. From an un-informed perspective, they seem uneeded as the code appears to only be concerned with a single eligible job at any point in time.
from delayed_job_active_record.
Those change were introduced in #29.
@scosman, can you work on a patch that works on MySQL as well as Postgres? Otherwise, I will need to revert your changes.
I'm going to work on making the tests run on MySQL, Postgres, and SQLite. Currently, the only run on SQLite. π¦
from delayed_job_active_record.
Sorry about that. Revert for now and I'll submit an update later (I don't have a MySQL install handy to test changes on).
What compatibility are you targeting for the project? Postgres, MySQL and SQLite?
from delayed_job_active_record.
In the meantime, using an earlier version of the gem (0.3.3 @f276ec2cb2) seems to be working with my local test suite.
I eagerly await the new changeset πΈ
from delayed_job_active_record.
What compatibility are you targeting for the project? Postgres, MySQL and SQLite?
Yes, for now. Those are the three most popular open-source databases. This project canβt afford to test against commercial databases (Oracle, Microsoft SQL Server, etc.)
I should have tests running (and failing) under MySQL on Travis CI later today.
@scosman I can help you get MySQL up and running on your local machine. Even though you wrote this code, I donβt hold you responsible for the failure. I reviewed and merged your pull request and should have tested again MySQL. Letβs work on fixing this together. Let me know what time is convenient for you.
from delayed_job_active_record.
Unfortunately I don't have time to install MySQL this week, but this "should" fix the issue:
scosman@c9703fa
MySQL supports UPDATE...LIMIT which makes this easy using basic active_record updates. I couldn't test this fix as I don't have MySQL set up, but from reading AR/MySQL documentation it should work.
Anyone have a local environment to test on?
from delayed_job_active_record.
If someone can verify this fix, I'll merge it upstream. To do so, make the following change to your Gemfile
:
-gem 'delayed_job_active_record'
+gem 'delayed_job_active_record', :git => '[email protected]:scosman/delayed_job_active_record.git'
The run the command
bundle install
from delayed_job_active_record.
Fixed worked for me. Thanks.
from delayed_job_active_record.
I got the tests running on Postgres, MySQL and SQLite on Travis. Then I applied @scosman's patch and everything passes. This ought to prevent database-specific failures in the future.
@scosman Thank you for pushing this patch so quickly!
@jensblond Thank you for testing this patch!
I'll release gem version 0.4.1 shortly.
from delayed_job_active_record.
Unfortunately, these changes do not work on PostgreSQL 8.4 which is for example what ships with RHEL6.
from delayed_job_active_record.
Related Issues (20)
- Rails 6.1.0.alpha support HOT 3
- `Delayed::Job` no longer defined in initializers HOT 16
- Delayed::DeserializationError: Job failed to load: undefined class/module Spree::AccountSalesRecordMailer.
- undefined method `table_name=` for Delayed::Backend::ActiveRecord::Job:Class HOT 1
- 4.1.5 breaking changes HOT 5
- A way to get the job ID inside a worker? HOT 2
- Error in 4.1.5 when upgrading Rails from 6.0 to 6.1 HOT 2
- Job running on 2 workers at once after timeout HOT 1
- Delayed job stops, the jobs are stuck in postgres HOT 6
- Rails 7 Support HOT 9
- Use case for locked_by in the ready_to_run query HOT 1
- Use `update` instead of `update_all` in the reserve_with_scope_using_optimized_mysql method.
- Do that destroy_failed_jobs get honored by delayed_job?
- Problem with DelayedJob Psych gem when upgrading to Ruby 2.7.5 HOT 2
- Rails 7 weird error: can't dump anonymous module HOT 3
- Can't create Delayed::Job record after `errors.add` in model HOT 1
- How does max_attempts interface with ActiveJob retry_on method?
- Deprecation warning in rails 7.1 HOT 1
- Need a new release to support rails 7.1
- Don't optimize mysql query with trilogy gem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed_job_active_record.