summaryrefslogtreecommitdiff
path: root/libmysqlpp
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqlpp')
-rw-r--r--libmysqlpp/my-connection.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmysqlpp/my-connection.cpp b/libmysqlpp/my-connection.cpp
index 6e4d1a1..30cef18 100644
--- a/libmysqlpp/my-connection.cpp
+++ b/libmysqlpp/my-connection.cpp
@@ -210,6 +210,9 @@ MySQL::Connection::beginBulkUpload(const char * table, const char * extra)
void
MySQL::Connection::endBulkUpload(const char * msg)
{
+ if (!ctx) {
+ throw std::logic_error("No bulk upload in progress");
+ }
ctx->loadBuf = nullptr;
ctx->loadBufLen = 0;
ctx->bufOff = msg ? -1 : 0;
@@ -228,6 +231,9 @@ MySQL::Connection::endBulkUpload(const char * msg)
size_t
MySQL::Connection::bulkUploadData(const char * data, size_t len) const
{
+ if (!ctx) {
+ throw std::logic_error("No bulk upload in progress");
+ }
ctx->loadBuf = data;
ctx->loadBufLen = len;
ctx->bufOff = 0;