Skip to content
Snippets Groups Projects
Commit f83ebea6 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Merge branch 'image_support_insert_query_fix' into 'image_support_lofar_fixes'

L2SS-710: Fix looping over image vector elements when constructing pqxx query.

See merge request !1
parents ba7eee3b 5fddccf1
No related branches found
No related tags found
1 merge request!1L2SS-710: Fix looping over image vector elements when constructing pqxx query.
...@@ -208,11 +208,17 @@ public: ...@@ -208,11 +208,17 @@ public:
// In case of image, unwrap the vector. // In case of image, unwrap the vector.
assert(value.dim_x != 0); assert(value.dim_x != 0);
assert(value.dim_x * value.dim_y <= value.size());
std::stringstream result; std::stringstream result;
result << "{"; result << "{";
for(std::size_t i = 0; i != value.size() % value.dim_x; ++i) for(std::size_t i = 0; i != value.dim_y; ++i)
{ {
if (i > 0)
{
result << ",";
}
result << "{" << separated_list(",", std::next(value.begin(), i * value.dim_x), std::next(value.begin(), (i+1) * value.dim_x)) << "}"; result << "{" << separated_list(",", std::next(value.begin(), i * value.dim_x), std::next(value.begin(), (i+1) * value.dim_x)) << "}";
} }
result << "}"; result << "}";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment