mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-10 09:17:39 +01: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
@@ -347,6 +347,12 @@ class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
|
||||
'INSERT INTO {{%T_upsert}} ("email", [[time]]) SELECT :phEmail AS "email", now() AS [[time]] ON CONFLICT ("email") DO UPDATE SET "ts"=:qp1, [[orders]]=T_upsert.orders + 1',
|
||||
],
|
||||
],
|
||||
'no columns to update' => [
|
||||
3 => [
|
||||
'WITH "EXCLUDED" ("a") AS (VALUES (CAST(:qp0 AS int2))) INSERT INTO "T_upsert_1" ("a") SELECT "a" FROM "EXCLUDED" WHERE NOT EXISTS (SELECT 1 FROM "T_upsert_1" WHERE (("T_upsert_1"."a"="EXCLUDED"."a")))',
|
||||
'INSERT INTO "T_upsert_1" ("a") VALUES (:qp0) ON CONFLICT DO NOTHING',
|
||||
],
|
||||
],
|
||||
];
|
||||
$newData = parent::upsertProvider();
|
||||
foreach ($concreteData as $testName => $data) {
|
||||
|
||||
Reference in New Issue
Block a user