Showing 1 changed files with 22 additions and 0 deletions
+22
t/common.t
... ...
@@ -4191,6 +4191,28 @@ $rows = $dbi->select(
4191 4191
 )->all;
4192 4192
 is_deeply($rows, [{"${table1}_$key1" => 1, "${table2}_$key1" => 1, $key2 => 2, $key3 => 5}]);
4193 4193
 
4194
+$dbi = DBIx::Custom->connect;
4195
+eval { $dbi->execute("drop table $table1") };
4196
+$dbi->execute($create_table1);
4197
+$dbi->insert(table => $table1, param => {$key1 => 1, $key2 => 2});
4198
+$dbi->insert(table => $table1, param => {$key1 => 3, $key2 => 4});
4199
+eval { $dbi->execute("drop table $table2") };
4200
+$dbi->execute($create_table2);
4201
+$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 5});
4202
+eval { $dbi->execute("drop table $table3") };
4203
+$dbi->execute("create table $table3 ($key3 int, $key4 int)");
4204
+$dbi->insert(table => $table3, param => {$key3 => 5, $key4 => 4});
4205
+$rows = $dbi->select(
4206
+    table => $table1,
4207
+    column => "$table1.$key1 as ${table1}_$key1, $table2.$key1 as ${table2}_$key1, $key2, $key3",
4208
+    where   => {"$table1.$key2" => 2},
4209
+    join  => {
4210
+        clause => "left outer join $table2 on $table1.$key1 = $table2.$key1",
4211
+        table => [$table1, $table2]
4212
+    }
4213
+)->all;
4214
+is_deeply($rows, [{"${table1}_$key1" => 1, "${table2}_$key1" => 1, $key2 => 2, $key3 => 5}]);
4215
+
4194 4216
 $rows = $dbi->select(
4195 4217
     table => $table1,
4196 4218
     where   => {$key1 => 1},