From: Warren Young Date: February 20 2007 12:19pm Subject: Re: Two bugs in 2.2.0 List-Archive: http://lists.mysql.com/plusplus/6365 Message-Id: <45DAE754.8030001@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Joseph Artsimovich wrote: > > char* > Query::preview_char() > { > std::string const str(sbuffer_.str()); > char* s = new char[str.size() + 1]; > memcpy(s, str.c_str(), str.size() + 1); > } This makes one more copy than is necessary. Please try the code currently in svn, as it should accomplish the same end without the double copy. > 2. Connection copy constructor doesn't work, because it doesn't initialize > is_connected_ member, which is then accessed here: > ----------------------------------- > void > Connection::copy(const Connection& other) > { > if (connected()) { > disconnect(); > } Thanks for letting me know. It should be fixed in svn now.