From 8264e9a3609f77ba5fa7f04e24a37abc07dced5c Mon Sep 17 00:00:00 2001 From: Robert Guico Date: Thu, 7 Mar 2024 10:26:44 -0600 Subject: [PATCH 1/2] Add failing test. --- tests/EndToEndTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/EndToEndTest.php b/tests/EndToEndTest.php index 262f9653..d6699d04 100644 --- a/tests/EndToEndTest.php +++ b/tests/EndToEndTest.php @@ -1138,6 +1138,13 @@ public function testSelectNullableFields() ); } + public function testUpdateWithOrderAndPrimaryKey() + { + $pdo = self::getConnectionToFullDB(false); + $pdo->exec('UPDATE `video_game_characters` SET `bio_en` = "spiky boi" WHERE `id` = 7 ORDER BY `id` DESC LIMIT 1'); + } + + private static function getPdo(string $connection_string, bool $strict_mode = false) : \PDO { $options = $strict_mode ? [\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode="STRICT_ALL_TABLES"'] : []; From 089c9c88a3354fe31eab57020347bec00c90c78f Mon Sep 17 00:00:00 2001 From: Robert Guico Date: Thu, 7 Mar 2024 10:39:44 -0600 Subject: [PATCH 2/2] Make simpler. --- tests/EndToEndTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndTest.php b/tests/EndToEndTest.php index d6699d04..8b4c8a5c 100644 --- a/tests/EndToEndTest.php +++ b/tests/EndToEndTest.php @@ -1141,7 +1141,7 @@ public function testSelectNullableFields() public function testUpdateWithOrderAndPrimaryKey() { $pdo = self::getConnectionToFullDB(false); - $pdo->exec('UPDATE `video_game_characters` SET `bio_en` = "spiky boi" WHERE `id` = 7 ORDER BY `id` DESC LIMIT 1'); + $pdo->exec('UPDATE `video_game_characters` SET `bio_en` = "spiky boi" WHERE `id` = 7 ORDER BY `id` DESC'); }