List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:August 5 2009 1:41am
Subject:Re: Question about store() override
View as plain text  
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.
Thread
Question about store() overrideJim Wallace4 Aug
  • Re: Question about store() overrideWarren Young5 Aug
    • RE: Question about store() overrideJim Wallace5 Aug
      • Re: Question about store() overrideWarren Young5 Aug
        • RE: Question about store() overrideJim Wallace6 Aug