From 847c4a22c80f9bd8ea544e23309d3575ed1be904 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Jul 2019 16:32:10 +0200 Subject: Fix bug in long data query parameter handling --- odb/mssql/query.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/odb/mssql/query.cxx b/odb/mssql/query.cxx index 08c5a90..2f3a5c1 100644 --- a/odb/mssql/query.cxx +++ b/odb/mssql/query.cxx @@ -389,9 +389,17 @@ namespace odb size_ += n; } - if (chunk == chunk_one || - chunk == chunk_last || - chunk == chunk_null) + if (chunk == chunk_one || chunk == chunk_last) + { + // Make sure the resulting buffer is not NULL (failed that, this + // parameter will be skipped by the query machinery). + // + if (size_ == 0) + buf_.capacity (1); + + break; + } + else if (chunk == chunk_null) break; } } -- cgit v1.1