5 #use DBIx::Class::Storage::DBI;
6 use DBIx::Class::Storage::DBI::Oracle::WhereJoins;
10 my $sa = new DBIC::SQL::Abstract::Oracle;
12 $sa->limit_dialect('RowNum');
14 is($sa->select('rubbish',
15 [ 'foo.id', 'bar.id', \'TO_CHAR(foo.womble, "blah")' ],
19 SELECT A.*, ROWNUM r FROM
21 SELECT foo.id AS col1, bar.id AS col2, TO_CHAR(foo.womble, "blah") AS col3 FROM rubbish
26 ', 'Munged stuff to make Oracle not explode');
29 # search with undefined or empty $cond
31 # my ($self, $table, $fields, $where, $order, @rest) = @_;
35 { "-join_type" => "LEFT", artist => "artist" },
36 { "artist.artistid" => "me.artist" },
39 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
42 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( artist.artistid(+) = me.artist )', 'WhereJoins search with empty where clause');
47 { "-join_type" => "", artist => "artist" },
48 { "artist.artistid" => "me.artist" },
51 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
52 { 'artist.artistid' => 3 },
54 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( ( ( artist.artistid = me.artist ) AND ( artist.artistid = ? ) ) )', 'WhereJoins search with where clause');
59 { "-join_type" => "LEFT", artist => "artist" },
60 { "artist.artistid" => "me.artist" },
63 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
64 [{ 'artist.artistid' => 3 }, { 'me.cdid' => 5 }],
66 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( ( ( artist.artistid(+) = me.artist ) AND ( ( ( artist.artistid = ? ) OR ( me.cdid = ? ) ) ) ) )', 'WhereJoins search with or in where clause');