Subject: | Tangram fails to quote SQL "IN" items |
Using the &in method as part of a criteria:
my @objs = $st->select($remote, ($criteria) &
(($remote->{lang}->in(@langs)) | ($remote->{src} == 1))
);
Produces the following SQL fragment:
WHERE
(t2.node = 6 AND (t2.lang IN (en, de, fr) OR t2.src = 1))
Which fails (on MySQL at least) with the following error:
DBD::mysql::st execute failed: Unknown column 'en' in 'where clause'
at /usr/share/perl5/Tangram/Cursor.pm line 185.
because the items to match against are not quoted. I think Tangram
(Expr?) needs to check the type of the column and quote the element if
it is a string type.