List:MySQL++« Previous MessageNext Message »
From:Miklos Niedermayer Date:August 28 2000 6:05pm
Subject:Re: SIGSEV using Mysql++
View as plain text  
Hello,

Sander Pilon <sander@stripped>:

> Using this little example on linux with GCC 2.95.2
> 
> 	Result Do( string queryString )
> 	{
> 		Query query = con->query();
> 		query << "select * from thread_list_packed limit 1000";
> 
> 		cout << query.preview() << endl;
> 		Result res = query.store();
> 		return res;
> 	}
> 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 
> Anyone know why? Is this a bug? Or my mistake....


Your Do function seems OK, i think it's something else.  For eg.
you are trying to use an object that doesn't really exist.

Just for example:

	Result r=Do("select something, some-other-thing from something");
	Row row=r.begin();
	cout << r[2];
	
If r[2] doesn't exist, you can easily get a big segmentation fault.
So please take a look at other parts of your code.

And what is "con->query()"?  Surely, you are using "Connection * con",
okay.


Sorry for the late reply.

Bye
-- 
 ______  o _. __
/ / / (_(_(__(_)  @ bsd.hu

Thread
Vacationsinisa24 Aug
  • SIGSEV using Mysql++Sander Pilon26 Aug
    • Re: SIGSEV using Mysql++Miklos Niedermayer29 Aug