diff --git a/src/query/interpreter.cpp b/src/query/interpreter.cpp index 11e480ade..d1095dd8a 100644 --- a/src/query/interpreter.cpp +++ b/src/query/interpreter.cpp @@ -833,14 +833,14 @@ PreparedQuery PrepareInfoQuery( TypedValue(db->PropertyToName(item.second))}); } for (const auto &item : info.unique) { - std::stringstream properties; - utils::PrintIterable(properties, item.second, ", ", - [&db](auto &stream, const auto &entry) { - stream << db->PropertyToName(entry); - }); + std::vector properties; + properties.reserve(item.second.size()); + for (const auto &property : item.second) { + properties.emplace_back(db->PropertyToName(property)); + } results.push_back({TypedValue("unique"), TypedValue(db->LabelToName(item.first)), - TypedValue(properties.str())}); + TypedValue(std::move(properties))}); } return std::pair{results, QueryHandlerResult::NOTHING}; }; diff --git a/tests/unit/interpreter.cpp b/tests/unit/interpreter.cpp index c7e87b96b..954de10c7 100644 --- a/tests/unit/interpreter.cpp +++ b/tests/unit/interpreter.cpp @@ -402,7 +402,10 @@ TEST_F(InterpreterTest, UniqueConstraintTest) { ASSERT_EQ(result.size(), 3U); ASSERT_EQ(result[0].ValueString(), "unique"); ASSERT_EQ(result[1].ValueString(), "A"); - ASSERT_EQ(result[2].ValueString(), "a, b"); + const auto &properties = result[2].ValueList(); + ASSERT_EQ(properties.size(), 2U); + ASSERT_EQ(properties[0].ValueString(), "a"); + ASSERT_EQ(properties[1].ValueString(), "b"); } // Drop constraint.