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;
...