@@ -359,22 +359,45 @@ public function testInsertWithReturningPksWithPrimaryKeyString(): void
359359 $ command = $ db ->createCommand ();
360360 $ schema = $ db ->getSchema ();
361361
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 ();
364364 }
365365
366366 $ command ->createTable (
367- '{{test_insert_ex_string }} ' ,
367+ '{{test_insert_pk }} ' ,
368368 ['id ' => 'varchar(10) primary key ' , 'name ' => 'varchar(10) ' ],
369369 )->execute ();
370370
371- $ result = $ command ->insertWithReturningPks ('{{test_insert_ex_string }} ' , ['id ' => '1 ' , 'name ' => 'test ' ]);
371+ $ result = $ command ->insertWithReturningPks ('{{test_insert_pk }} ' , ['id ' => '1 ' , 'name ' => 'test ' ]);
372372
373373 $ this ->assertSame (['id ' => '1 ' ], $ result );
374374
375375 $ db ->close ();
376376 }
377377
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+
378401 /**
379402 * @throws Exception
380403 * @throws InvalidConfigException
0 commit comments