Showing 2 changed files with 15 additions and 1 deletions
-1
Changes
... ...
@@ -1,7 +1,6 @@
1 1
 0.1738
2 2
     - insert method id value is not copied to parameter
3 3
       if the key exists in parameter
4
-    
5 4
 0.1737
6 5
     - micro optimization
7 6
     - fixed DEBUG messsage bug
+15
t/common.t
... ...
@@ -2323,6 +2323,21 @@ is($dbi->select(table => $table1)->one->{$key2}, 4);
2323 2323
 is($dbi->select(table => $table1)->one->{$key3}, 3);
2324 2324
 is_deeply($param, {$key3 => 3, $key2 => 4});
2325 2325
 
2326
+$dbi = DBIx::Custom->connect;
2327
+eval { $dbi->execute("drop table $table1") };
2328
+$dbi->execute($create_table1_2);
2329
+$param = {$key3 => 3, $key2 => 4};
2330
+$DB::single = 1;
2331
+$query = $dbi->insert(
2332
+    $param,
2333
+    primary_key => [$key1, $key2], 
2334
+    table => $table1,
2335
+    id => [1, 2],
2336
+    query => 1
2337
+);
2338
+is(ref $query, 'DBIx::Custom::Query');
2339
+is_deeply($param, {$key3 => 3, $key2 => 4});
2340
+
2326 2341
 test 'model insert id and primary_key option';
2327 2342
 $dbi = MyDBI6->connect;
2328 2343
 eval { $dbi->execute("drop table $table1") };