aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-07-04 16:32:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-07-04 16:32:10 +0200
commit847c4a22c80f9bd8ea544e23309d3575ed1be904 (patch)
tree1b4970e49222bbfa173b0f098a4dd7cb4cea9e80
parentc4bff62140e2b3df21fcd935abba968abcd6e5bd (diff)
Fix bug in long data query parameter handling
-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;
}
}