diff --git a/src/Param/ParamValueConverterRegistry.php b/src/Param/ParamValueConverterRegistry.php index 322c9d5..7978553 100644 --- a/src/Param/ParamValueConverterRegistry.php +++ b/src/Param/ParamValueConverterRegistry.php @@ -290,6 +290,7 @@ private function splitTypes(string $types): array } elseif ($char === ')') { $depth--; } elseif ($char === ',' && $depth === 0) { + $current = trim($current); $result[] = $current; $current = ''; diff --git a/tests/Param/ParamValueConverterRegistryTest.php b/tests/Param/ParamValueConverterRegistryTest.php index 282dbe9..d7cd325 100644 --- a/tests/Param/ParamValueConverterRegistryTest.php +++ b/tests/Param/ParamValueConverterRegistryTest.php @@ -121,6 +121,11 @@ public static function providerConvert(): Generator yield 'Tuple' => ['Tuple(String, Int8)', "('k',1)", "('k',1)"]; yield 'Tuple (array)' => ['Tuple(String, Int8)', ['k', 1], "('k',1)"]; + yield 'Tuple (array complex)' => [ + 'Tuple(Tuple(UInt32, String), UInt64, UInt8)', + [[1, 'k'], 1 , 2], + "((1,'k'),1,2)", + ]; if (ClickHouseVersion::get() >= self::VersionIntervalJsonObject) { yield 'JSON' => ['JSON', '{"k":"v"}', '{"k":"v"}'];