From 91d65246a090f2c661f4670200595b03b6d63a0d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Jul 2012 16:04:11 +0200 Subject: Handle special case of array of zero elements --- odb/pgsql/simple-object-statements.hxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/odb/pgsql/simple-object-statements.hxx b/odb/pgsql/simple-object-statements.hxx index d3938f4..57cf685 100644 --- a/odb/pgsql/simple-object-statements.hxx +++ b/odb/pgsql/simple-object-statements.hxx @@ -486,11 +486,15 @@ namespace odb // std::size_t insert_image_version_; binding insert_image_binding_; - bind insert_image_bind_[insert_column_count]; + bind insert_image_bind_[ + insert_column_count != 0 ? insert_column_count : 1]; native_binding insert_image_native_binding_; - char* insert_image_values_[insert_column_count]; - int insert_image_lengths_[insert_column_count]; - int insert_image_formats_[insert_column_count]; + char* insert_image_values_[ + insert_column_count != 0 ? insert_column_count : 1]; + int insert_image_lengths_[ + insert_column_count != 0 ? insert_column_count : 1]; + int insert_image_formats_[ + insert_column_count != 0 ? insert_column_count : 1]; // Update binding. Note that the id suffix is bound to id_image_ // below instead of image_ which makes this binding effectively -- cgit v1.1