List:MySQL++« Previous MessageNext Message »
From:Dovid Kopel Date:November 14 2004 11:18pm
Subject:Getting a segfaul
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm getting a segfault and hoping you guys can help.

#include "mysql.h"
#include <mysql++.h>
#include <iomanip>

using namespace std;
database::database(const char *db_db, const char *db_host, const char
*db_user, const char *db_passwd)
{
	con = new mysqlpp::Connection(db_db, db_host, db_user, db_passwd);
}

int database::connect(const char *db_db, const char *db_host, const char
*db_user, const char *db_passwd)
{
	//database::con(db_db, db_host, db_user, db_passwd);
	return(0);
}

int database::exquery(const char *myquery)
{
	try
	{
		mysqlpp::Query query = con.query();
		query << "select * from cars";
		cout << "Query: " << query.preview() << endl;
		mysqlpp::Result res = query.store();
		cout << "Records Found: " << res.size() << endl << endl;
	}
	catch (mysqlpp::BadQuery er)
	{ // handle any connection or
~                          // query errors that may come up
		cerr << "Error: " << er.error << endl;
~    		return -1;
	}
	return(0);
}


********
The output:

Query: select * from cars
Error:
Segmentation fault


Help is appreciated, thank you in advance!
- --
- -=mUnky=-
- -Dovid Kopel
(516)-655-0489
munky@stripped
http://www.munkys.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBl+e8CecRKprSbsERAqntAJ9EIOWhhlEY8siJJ/joFzv9/EszzwCfVZ+G
QaxoeWbx9zZiHKEm1YPV9C0=
=LnKt
-----END PGP SIGNATURE-----

Thread
Getting a segfaulDovid Kopel15 Nov
  • Re: Getting a segfaulWarren Young15 Nov
    • Re: Getting a segfaulWarren Young15 Nov
Re: Getting a segfaulWarren Young17 Nov