diff --git a/src/backends/mysql/blob.cpp b/src/backends/mysql/blob.cpp index 4cc1d0618..a6d673aa0 100644 --- a/src/backends/mysql/blob.cpp +++ b/src/backends/mysql/blob.cpp @@ -11,7 +11,6 @@ #include #include -#include #ifdef _MSC_VER #pragma warning(push) @@ -64,8 +63,6 @@ std::size_t mysql_blob_backend::hex_str_size() const void mysql_blob_backend::write_hex_str(char *buf, std::size_t size) const { - assert(size >= hex_str_size()); - if (size < hex_str_size()) { throw soci_error("MySQL BLOB: Provided buffer is too small to hold hex string"); @@ -114,8 +111,6 @@ void mysql_blob_backend::load_from_hex_str(const char *str, std::size_t length) if (nBytes > 0) { - assert(nBytes > 1); - // The first "byte" as detected by above calculation is only the prefix "0x" nBytes -= 1; } diff --git a/src/core/blob.cpp b/src/core/blob.cpp index b5ba6197f..f42930ed7 100644 --- a/src/core/blob.cpp +++ b/src/core/blob.cpp @@ -11,7 +11,6 @@ #include "soci/soci-platform.h" #include -#include using namespace soci; @@ -24,13 +23,11 @@ blob::~blob() = default; std::size_t blob::get_len() { - assert(backEnd_); return backEnd_->get_len(); } std::size_t blob::read(std::size_t offset, char *buf, std::size_t toRead) { - assert(backEnd_); SOCI_ALLOW_DEPRECATED_BEGIN return backEnd_->read(offset, buf, toRead); SOCI_ALLOW_DEPRECATED_END @@ -39,14 +36,12 @@ std::size_t blob::read(std::size_t offset, char *buf, std::size_t toRead) std::size_t blob::read_from_start(char * buf, std::size_t toRead, std::size_t offset) { - assert(backEnd_); return backEnd_->read_from_start(buf, toRead, offset); } std::size_t blob::write( std::size_t offset, char const * buf, std::size_t toWrite) { - assert(backEnd_); SOCI_ALLOW_DEPRECATED_BEGIN return backEnd_->write(offset, buf, toWrite); SOCI_ALLOW_DEPRECATED_END @@ -55,18 +50,15 @@ std::size_t blob::write( std::size_t blob::write_from_start(const char * buf, std::size_t toWrite, std::size_t offset) { - assert(backEnd_); return backEnd_->write_from_start(buf, toWrite, offset); } std::size_t blob::append(char const * buf, std::size_t toWrite) { - assert(backEnd_); return backEnd_->append(buf, toWrite); } void blob::trim(std::size_t newLen) { - assert(backEnd_); backEnd_->trim(newLen); }