List:MySQL++« Previous MessageNext Message »
From:Kevin Regan Date:June 15 2009 9:12pm
Subject:Using mysqlpp::quote on a std::ostringstream?
View as plain text  
Looking through my code (written by someone else), I'm seeing that we are using a
std::ostringstream to build up arguments to a stored procedure.  We than call "str()" on
that stream and insert the results into a query object.  We do this because we want to
allow the arguments to be set before we actually create the Connection or Query objects.

We are using the "mysqlpp::quote" mechanism when inserting strings into the
std::ostringstream.  This worked with 2.x, but not for 3.x (the strings are not quoted). 
Looking through manip.cpp, it looks like this is documented as not being a supported
action (although there is some code that attempts to do the right thing anyway).

I'm guessing that we were just using an unsupported mechanism that no longer works the way
we wanted it to.  Is this correct?

Can anyone recommend an alternate approach?  The idea would be to be able to set the
arguments (of various types) before the Connection or Query objects are created.

Kevin Regan
F5 Networks

Using mysqlpp::quote on a std::ostringstream?Kevin Regan15 Jun