From 1b5f4dcde7811309689a662460e2c84a6fec9730 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 12 Jul 2013 16:32:13 +0200 Subject: [PATCH] livestatus: join csv arrays into comma seperated string refs #4374 --- components/livestatus/query.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/livestatus/query.cpp b/components/livestatus/query.cpp index 9c19b3ac1..74513257e 100644 --- a/components/livestatus/query.cpp +++ b/components/livestatus/query.cpp @@ -280,7 +280,22 @@ void Query::PrintResultSet(std::ostream& fp, const std::vector& columns, else fp << ";"; - fp << Convert::ToString(value); + if (value.IsObjectType()) { + bool first_inner = true; + Array::Ptr arr = static_cast(value); + + ObjectLock rlock(arr); + BOOST_FOREACH(const Value& arr_val, arr) { + if (first_inner) + first_inner = false; + else + fp << ","; + + fp << Convert::ToString(arr_val); + } + } else { + fp << Convert::ToString(value); + } } fp << "\n"; -- 2.40.0