On Tue, Sep 09, 2003 at 03:53:02PM +0100, Brian Butcher wrote:
> I have been using mysqlcppapi for the last two or three weeks and in general I
> find it much cleaner than mysqlc++. Thanks to the developers.
>
> Two bugs or features though:
> The following code appends the two queries rather than creates two distinct
> queries.
>
> mysqlcppapi::Query query = con.create_Query();
> query << "UPDATE W32 SET who=who2";
> con.create_Query();
^^^^
Is this what you meant?
This will simply discard the return value of con_Query() and therefore
the << operation writes to the same Query object and the text is
appended.
If the line was supposed to be
query = con.create_Query();
then yes, the stream contents are not changed by Query::operator=.
I have a patch to copy the stream contents, but can't get a diff because
the sourceforge CVS server is being annoying.
The patch involves calling this->str(src.str()) in SQLQuery::operator=
and initialising the stringstream member in the SQLQuery copy ctor with
std::stringstream(src.str()).
I've been planning to submit this patch for a while. Murray, shall I put
it in the patch mgr as soon as I can get a diff from CVS?
jon
--
"More computing sins are committed in the name of efficiency
(without necessarily achieving it) than for any other single reason
- including blind stupidity."
- W.A. Wulf
|