Subject: | Table self-join does not work correctly |
Environment:
DBD::SQLite 0.21 (FreeBSD port)
Perl, version 5.005_03 built for i386-freebsd
FreeBSD spiti 4.6.2-RELEASE-p2
The sequence:
CREATE TABLE SysViews( Id integer, Name varchar, EditView integer, PRIMARY KEY( Id))
INSERT INTO SysViews VALUES (1, 'foo', NULL)
SELECT SysViews.Name
FROM SysViews
LEFT JOIN SysViews AS E
ON E.Id = SysViews.EditView
WHERE SysViews.Id = 1
incorrectly returns undef
The same select in sqlite-2.7.3 correctly returns foo
I believe upgrading DBD:SQLite to use the sqlite-2.7.3 code base might fix the problem since a
quick diff showed a lot of changes in the JOIN code. An option for linking against the
sqlite library might also be a good idea.
Thanks, Diomidis