From 1f035fdd993aac88a5f32cb88247f9a56cf13c24 Mon Sep 17 00:00:00 2001 From: Angel Date: Sat, 3 Feb 2024 19:20:34 +0800 Subject: [PATCH] [fix] Conflict LIKE clause key #1111 --- src/Medoo.php | 5 +++-- tests/WhereTest.php | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Medoo.php b/src/Medoo.php index c377bcac..244d9b59 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -942,14 +942,15 @@ protected function dataImplode(array $data, array &$map, string $conjunctor): st $likeClauses = []; foreach ($value as $index => $item) { + $likeKey = "{$mapKey}_{$index}_i"; $item = strval($item); if (!preg_match('/((?database->select("account", "user_name", [ "city[~]" => "%stan", + "company[~]" => "Goo%", "location[~]" => "Londo_", "name[~]" => "[BCR]at", "nickname[~]" => "[!BCR]at" @@ -690,6 +691,7 @@ public function testWildcardLikeWhere($type) FROM "account" WHERE ("city" LIKE '%stan') AND + ("company" LIKE 'Goo%') AND ("location" LIKE 'Londo_') AND ("name" LIKE '[BCR]at') AND ("nickname" LIKE '[!BCR]at')