mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-30 10:08:08 +08:00
Fix #17504: Fix upsert when $updateColumns = true but there are no columns to update in the table
This commit is contained in:
committed by
Alexander Makarov
parent
f72f7c7406
commit
cdd40b8dfb
@ -2171,6 +2171,17 @@ abstract class QueryBuilderTest extends DatabaseTestCase
|
||||
':qp1' => 0,
|
||||
],
|
||||
],
|
||||
'no columns to update' => [
|
||||
'T_upsert_1',
|
||||
[
|
||||
'a' => 1,
|
||||
],
|
||||
true,
|
||||
null,
|
||||
[
|
||||
':qp0' => 1,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@ -2182,6 +2193,8 @@ abstract class QueryBuilderTest extends DatabaseTestCase
|
||||
* @param array|null $updateColumns
|
||||
* @param string|string[] $expectedSQL
|
||||
* @param array $expectedParams
|
||||
* @throws \yii\base\NotSupportedException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testUpsert($table, $insertColumns, $updateColumns, $expectedSQL, $expectedParams)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user