Table list (PApps::DB::List) has fields:
id AUTO_INC
code VARCHAR
etag INT
Table list_distro (PApps::DB::ListDistro) has fields:
list_id
distro_id
Table distro (PApps::DB::Distro) has fields:
id AUTO_INC
name VARCHAR
etag INT
list & distro are joined in a many-to-many relationship with
list_distro joining them.
This script dies with an error. Shouldn't it work?
#!/usr/bin/perl
use v5.18;
use warnings;
use PApps::DB::List;
Rose::DB::Object::Manager->update_objects(
object_class => 'PApps::DB::List',
require_objects => ['distros'],
set => { 't1.etag' => \'t1.etag + 1' },
where => [
'distros.name' => 'Mojolicious',
],
debug => 1,
);
And the error:
DBD::mysql::st execute failed: 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 'WHERE
t3.name = 'Mojolicious'
ORDER BY
t1.id' at line 5 at
/home/pm/perl5/lib/perl5/Rose/DB/Object/Manager.pm line 3375.
update_objects() - DBD::mysql::st execute failed: 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 'WHERE
t3.name = 'Mojolicious'
ORDER BY
t1.id' at line 5 at
/home/pm/perl5/lib/perl5/Rose/DB/Object/Manager.pm line 3375.
at /home/pm/perl5/lib/perl5/Rose/DB/Object/Manager.pm line 3387.
Rose::DB::Object::Manager::update_objects('Rose::DB::Object::Manager',
'object_class', 'PApps::DB::List', 'require_objects',
'ARRAY(0x12a2cb8)', 'set', 'HASH(0x12c04f0)', 'where',
'ARRAY(0x12c05b0)', ...) called at
update-join.pl line 8
shell returned 255
Unfortunately the mysql logs are not showing the query for some
strange reason.