aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/mssql/query.cxx14
1 files 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;
}
}