diff --git a/src/core/statement.cpp b/src/core/statement.cpp index 437f4f24..738ef6f6 100644 --- a/src/core/statement.cpp +++ b/src/core/statement.cpp @@ -285,6 +285,11 @@ bool statement_impl::execute(bool withDataExchange) fetchSize_ = initialFetchSize_; + // pre-use should be executed before inspecting the sizes of use + // elements, as they can be resized in type conversion routines + + pre_use(); + std::size_t bindSize = uses_size(); if (bindSize > 1 && fetchSize_ > 1) @@ -293,8 +298,6 @@ bool statement_impl::execute(bool withDataExchange) "Bulk insert/update and bulk select not allowed in same query"); } - pre_use(); - // looks like a hack and it is - row description should happen // *after* the use elements were completely prepared // and *before* the into elements are touched, so that the row