@@ -359,22 +359,45 @@ public function testInsertWithReturningPksWithPrimaryKeyString(): void
359
359
$ command = $ db ->createCommand ();
360
360
$ schema = $ db ->getSchema ();
361
361
362
- if ($ schema ->getTableSchema ('{{test_insert_ex_string }} ' ) !== null ) {
363
- $ command ->dropTable ('{{test_insert_ex_string }} ' )->execute ();
362
+ if ($ schema ->getTableSchema ('{{test_insert_pk }} ' ) !== null ) {
363
+ $ command ->dropTable ('{{test_insert_pk }} ' )->execute ();
364
364
}
365
365
366
366
$ command ->createTable (
367
- '{{test_insert_ex_string }} ' ,
367
+ '{{test_insert_pk }} ' ,
368
368
['id ' => 'varchar(10) primary key ' , 'name ' => 'varchar(10) ' ],
369
369
)->execute ();
370
370
371
- $ result = $ command ->insertWithReturningPks ('{{test_insert_ex_string }} ' , ['id ' => '1 ' , 'name ' => 'test ' ]);
371
+ $ result = $ command ->insertWithReturningPks ('{{test_insert_pk }} ' , ['id ' => '1 ' , 'name ' => 'test ' ]);
372
372
373
373
$ this ->assertSame (['id ' => '1 ' ], $ result );
374
374
375
375
$ db ->close ();
376
376
}
377
377
378
+ public function testInsertWithReturningPksWithPrimaryKeySignedDecimal (): void
379
+ {
380
+ $ db = $ this ->getConnection ();
381
+
382
+ $ command = $ db ->createCommand ();
383
+ $ schema = $ db ->getSchema ();
384
+
385
+ if ($ schema ->getTableSchema ('{{test_insert_pk}} ' ) !== null ) {
386
+ $ command ->dropTable ('{{test_insert_pk}} ' )->execute ();
387
+ }
388
+
389
+ $ command ->createTable (
390
+ '{{test_insert_pk}} ' ,
391
+ ['id ' => 'number(5,2) primary key ' , 'name ' => 'varchar(10) ' ],
392
+ )->execute ();
393
+
394
+ $ result = $ command ->insertWithReturningPks ('{{test_insert_pk}} ' , ['id ' => '-123.45 ' , 'name ' => 'test ' ]);
395
+
396
+ $ this ->assertSame (['id ' => '-123.45 ' ], $ result );
397
+
398
+ $ db ->close ();
399
+ }
400
+
378
401
/**
379
402
* @throws Exception
380
403
* @throws InvalidConfigException
0 commit comments