On Aug 4, 2009, at 5:19 AM, Jim Wallace wrote:
> Warren suggested casting the second parameter to mysqlpp::String
No, he suggested casting it to SQLString, a v2 class which became
SQLTypeAdapter in v3, not String. (You will find this pointed out in
the breakages chapter of the user manual.)
This does fix it; I just tested it.
The problem happens because there is a store(const char*, int)
overload, which is for taking a string with a length, needed to allow
query strings with embedded null characters. Without this, MySQL++
wouldn't support BLOBs naturally. (It didn't always exist, back in
the bad old days, and BLOBs were therefore a pain to use at the time.)
If you cast just the first parameter to STA, that doesn't help because
it can convert right back to const char*. Casting the second forces
the compiler to use the store(const STA&, const STA&) overload.