12 messages in com.mysql.lists.plusplusRe: Can you have more than one active...
FromSent OnAttachments
Byrial Jensen23 May 2005 15:00 
Earl Miles23 May 2005 15:12 
Warren Young24 May 2005 12:42 
Byrial Jensen25 May 2005 11:11 
Earl Miles25 May 2005 11:36 
Chris Frey25 May 2005 12:43 
Chris Frey25 May 2005 12:50 
Earl Miles25 May 2005 13:40 
Byrial Jensen25 May 2005 14:21 
Warren Young25 May 2005 20:27 
Byrial Jensen25 May 2005 21:52 
Warren Young25 May 2005 22:13 
Subject:Re: Can you have more than one active mysqlpp::Connection object?
From:Chris Frey (cdf@netdirect.ca)
Date:05/25/2005 12:43:32 PM
List:com.mysql.lists.plusplus

On Wed, May 25, 2005 at 11:37:07AM -0700, Earl Miles wrote:

From looking this over, I think your problem might be string manipulation.

const char *text = row[1];

I'm not sure row[] is guaranteed to return a null terminated string. Without a null terminator, strlen() is guaranteed to fail and fail badly. I believe what you really want is this (slightly longer than it has to be for clarity):

std::string tempString = row[1]; const char *test = tempString.c_str();

Yep, Earl is on the right track. See the declaration of operator[] in row.h:

const ColData operator [] (size_type i) const;

This returns a temporary, which disappears after that line of code. You need to make a copy for yourself.

- Chris