Dan Cook wrote:
> Note the BINARY(8) field can be NULL.
What happens if you ignore that detail for now? KISS.
> testDB.binary_data.data.assign(data_str.c_str(), data_str.length());
> testDB.binary_data.is_null = false;
This is more elegantly -- and perhaps correctly -- expressed:
testDB.binary_data = sql_blob(dataChar, sizeof(dataChar));
The intermediate std::string isn't of any use. Further, assigning a
value to Null<T> always resets the is_null flag, because of course it no
longer is null.
Notice that this will work whether binary_data is Null<>-wrapped or not.
Null<> tries to be fairly transparent. It doesn't really succeed, but