List:MySQL++« Previous MessageNext Message »
From:Joseph Artsimovich Date:February 12 2007 5:14pm
Subject:Two bugs in 2.2.0
View as plain text  
Hello,

I've got two bugs report:
1. Query::preview() adds extra null chars.
This one was reported by others, but I see it's still not fixed in SVN.
The fix is to remove "*this << std::ends;" from Query::str(SQLQueryParms& p) 
and make Query::preview_char() look like this:
-----------------------------------
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);
}
-----------------------------------
Note that reading one byte past the end of std::string data is OK, as 
std::strings are always null-terminated.

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();
        }
Thread
Two bugs in 2.2.0Joseph Artsimovich12 Feb
  • Column sizesgary clark12 Feb
    • Re: Column sizesWarren Young13 Feb
      • Re: Column sizesgary clark16 Feb
        • Re: Column sizesWarren Young16 Feb
          • Re: Column sizesgary clark16 Feb
            • UPDATE routine giving exceptiongary clark16 Feb
              • Re: UPDATE routine giving exceptionJonathan Wakely17 Feb
                • Re: UPDATE routine giving exceptiongary clark18 Feb
                  • Re: UPDATE routine giving exceptionJames Vanns19 Feb
                    • Re: UPDATE routine giving exceptiongary clark19 Feb
                      • Re: UPDATE routine giving exceptiongary clark23 Feb
                        • Re: UPDATE routine giving exceptionWarren Young23 Feb
                          • Re: UPDATE routine giving exceptiongary clark23 Feb
                            • Re: UPDATE routine giving exceptionWarren Young24 Feb
                              • Re: UPDATE routine giving exceptionIan Miller24 Feb
                              • Re: UPDATE routine giving exceptiongary clark24 Feb
                                • Re: UPDATE routine giving exceptiongary clark28 Feb
                                  • Re: UPDATE routine giving exceptionWarren Young1 Mar
                                    • Re: UPDATE routine giving exceptiongary clark1 Mar
                                    • Re: UPDATE routine giving exceptiongary clark19 Mar
                                      • Re: UPDATE routine giving exceptionWarren Young19 Mar
                                        • Re: UPDATE routine giving exceptiongary clark19 Mar
                                          • Re: UPDATE routine giving exceptionWarren Young19 Mar
                                            • Re: UPDATE routine giving exceptiongary clark20 Mar
  • Re: Two bugs in 2.2.0Warren Young20 Feb
    • Re: Two bugs in 2.2.0Joseph Artsimovich20 Feb
      • Re: Two bugs in 2.2.0Jonathan Wakely20 Feb
        • Re: Two bugs in 2.2.0Joseph Artsimovich20 Feb
          • Re: Two bugs in 2.2.0Jonathan Wakely20 Feb
            • Re: Two bugs in 2.2.0Joseph Artsimovich20 Feb
              • Re: Two bugs in 2.2.0Jonathan Wakely20 Feb
        • Re: Two bugs in 2.2.0Warren Young20 Feb