Skip to content

Commit f9196e1

Browse files
committed
Update
1 parent 7ab1ef1 commit f9196e1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/Provider/QueryBuilderProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public static function upsert(): array
439439
'regular values with update part' => [
440440
3 => 'MERGE [T_upsert] WITH (HOLDLOCK) USING (VALUES (:qp0, :qp1, :qp2, :qp3)) AS EXCLUDED ' .
441441
'([email], [address], [status], [profile_id]) ON ([T_upsert].[email]=EXCLUDED.[email]) ' .
442-
'WHEN MATCHED THEN UPDATE SET [address]=:qp4, [status]=:qp5, [orders]=T_upsert.orders + 1 ' .
442+
'WHEN MATCHED THEN UPDATE SET [address]=:qp4, [status]=2, [orders]=T_upsert.orders + 1 ' .
443443
'WHEN NOT MATCHED THEN INSERT ([email], [address], [status], [profile_id]) ' .
444444
'VALUES (EXCLUDED.[email], EXCLUDED.[address], EXCLUDED.[status], EXCLUDED.[profile_id]);',
445445
],
@@ -464,7 +464,7 @@ public static function upsert(): array
464464
3 => 'MERGE [T_upsert] WITH (HOLDLOCK) USING (SELECT [email], 2 AS [status] FROM [customer] ' .
465465
'WHERE [name] = :qp0 ORDER BY (SELECT NULL) OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY) AS EXCLUDED ' .
466466
'([email], [status]) ON ([T_upsert].[email]=EXCLUDED.[email]) ' .
467-
'WHEN MATCHED THEN UPDATE SET [address]=:qp1, [status]=:qp2, [orders]=T_upsert.orders + 1 ' .
467+
'WHEN MATCHED THEN UPDATE SET [address]=:qp1, [status]=2, [orders]=T_upsert.orders + 1 ' .
468468
'WHEN NOT MATCHED THEN INSERT ([email], [status]) VALUES (EXCLUDED.[email], EXCLUDED.[status]);',
469469
],
470470

@@ -508,7 +508,7 @@ public static function upsert(): array
508508
),
509509
3 => 'MERGE {{%T_upsert}} WITH (HOLDLOCK) USING (SELECT :phEmail AS [email], CONVERT(bigint, CURRENT_TIMESTAMP) AS [[ts]]) ' .
510510
'AS EXCLUDED ([email], [ts]) ON ({{%T_upsert}}.[email]=EXCLUDED.[email]) ' .
511-
'WHEN MATCHED THEN UPDATE SET [ts]=:qp1, [orders]=T_upsert.orders + 1 ' .
511+
'WHEN MATCHED THEN UPDATE SET [ts]=0, [orders]=T_upsert.orders + 1 ' .
512512
'WHEN NOT MATCHED THEN INSERT ([email], [ts]) VALUES (EXCLUDED.[email], EXCLUDED.[ts]);',
513513
],
514514

tests/QueryBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public function testUpdate(
444444
array|string $condition,
445445
array $params,
446446
string $expectedSql,
447-
array $expectedParams,
447+
array $expectedParams = [],
448448
): void {
449449
parent::testUpdate($table, $columns, $condition, $params, $expectedSql, $expectedParams);
450450
}

0 commit comments

Comments
 (0)