Subject: | Outer natural joins not actually outer |
According to my possibly flawed understanding, the statement
SELECT * FROM Prof OUTER NATURAL JOIN Subject
should produce a record for every row of Prof, even if there is no matching naturally-joined row in Subject. Accordingly, the attached patch adds a test for that condition to t/08join.t (which, alas, fails).
--- t/08join.t Thu Nov 10 17:47:29 2005
+++ ../SQL-Statement-1.15/t//08join.t Thu Nov 10 17:42:43 2005
@@ -8,7 +8,7 @@
plan skip_all => "No DBD::File available";
}
else {
- plan tests => 14;
+ plan tests => 15;
}
use SQL::Statement; printf "SQL::Statement v.%s\n", $SQL::Statement::VERSION;
use vars qw($dbh $sth $DEBUG);
@@ -49,6 +49,11 @@
queryresult_is("SELECT * FROM Prof LEFT JOIN Subject USING(pid)",
'1~Sue~Chem^2~Bob~Bio^2~Bob~Math^3~Tom~undef^',
'LEFT JOIN'
+);
+
+queryresult_is("SELECT * FROM Prof OUTER NATURAL JOIN Subject",
+ '1~Sue~Chem^2~Bob~Bio^2~Bob~Math^3~Tom~undef^',
+ 'OUTER NATURAL JOIN'
);
queryresult_is("SELECT pid,pname,sname FROM Prof LEFT JOIN Subject USING(pid)",