Skip Menu |

This queue is for tickets about the Minion-Backend-mysql CPAN distribution.

Report information
The Basics
Id: 108913
Status: resolved
Priority: 0/
Queue: Minion-Backend-mysql

People
Owner: Nobody in particular
Requestors: NALOBIN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Fails with error in SQL
I have an empty Minion db. I run worker for the first time: [Sat Nov 14 19:52:26 2015] [debug] Checking worker registry and job queue [Sat Nov 14 19:52:26 2015] [fatal] Worker error: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') order by priority desc, created limit 1 for update' at line 3 at /usr/local/share/perl/5.18.2/Mojo/mysql/Database.pm line 56, <DATA> line 727. This is the buggy subroutine. The commented line is a workaround for the problem. sub _try { my ($self, $id, $options) = @_; my $tasks = [keys %{$self->minion->tasks}]; #return undef unless @{ $tasks }; my $qq = join(", ", map({ "?" } @{ $options->{queues} // ['default'] })); my $qt = join(", ", map({ "?" } @{ $tasks })); my $db = $self->mysql->db; my $tx = $db->begin; my $job = $tx->db->query(qq(select id, args, retries, task from minion_jobs where state = 'inactive' and `delayed` <= NOW() and queue in ($qq) and task in ($qt) order by priority desc, created limit 1 for update), @{ $options->{queues} || ['default']}, @{ $tasks } )->hash; ...
On Sat Nov 14 09:57:23 2015, NALOBIN wrote: Show quoted text
> I have an empty Minion db. I run worker for the first time: > > [Sat Nov 14 19:52:26 2015] [debug] Checking worker registry and job > queue > [Sat Nov 14 19:52:26 2015] [fatal] Worker error: DBD::mysql::st > execute failed: You have an error in your SQL syntax; check the manual > that corresponds to your MariaDB server version for the right syntax > to use near ') > order by priority desc, created limit 1 for update' at line 3 at > /usr/local/share/perl/5.18.2/Mojo/mysql/Database.pm line 56, <DATA> > line 727. > > This is the buggy subroutine. The commented line is a workaround for > the problem. > > sub _try { > my ($self, $id, $options) = @_; > > my $tasks = [keys %{$self->minion->tasks}]; > > #return undef unless @{ $tasks }; > > my $qq = join(", ", map({ "?" } @{ $options->{queues} // ['default'] > })); > my $qt = join(", ", map({ "?" } @{ $tasks })); > > my $db = $self->mysql->db; > > my $tx = $db->begin; > my $job = $tx->db->query(qq(select id, args, retries, task from > minion_jobs > where state = 'inactive' and `delayed` <= NOW() and queue in ($qq) > and task in ($qt) > order by priority desc, created limit 1 for update), > @{ $options->{queues} || ['default']}, @{ $tasks } > )->hash; > ...
This has been merged to master and I will release 0.07 to fix this. Thanks for the patches!